I have one form but i want to submit to different route based on the link(button) the user clicks
`
{{ Form::open(['url'=> route('finance.invoices.store', ['pending', 'visit_id' => $visit->id]), 'id'=>'inv', 'method' => 'POST']) }}
<script>
$(document).ready(function() {
$("#proforma").click(function() {
// Code to execute when the "Send to Proforma" button is clicked
console.log("Send to Proforma button clicked");
});
$("#bill-btn").click(function() {
if ($("#inv").length) {
$("#inv").attr("action", "{{ route('finance.invoices.store', ['pending', 'visit_id' => $visit->id]) }}");
console.log("Bill Selected Items button clicked");
// Submit the form with the specified action
$("#inv")[0].submit();
}else{
console.log('not found')
}
});`
`<v-btn type="submit" id="proforma" color="warning" class="px-2">
<i class="fa fa-money pr-2"></i>button 1
</v-btn>
<v-btn type="submit" id="bill-btn" color="success" class="px-2">
<i class="fa fa-money pr-2"></i> button 2
</v-btn>
</v-card-actions>
<input type="hidden" name="removedItems" />
{{ Form::close() }}
How can achieve such that when i click the `button 1 it submits to route 1 and same to button 2.