I have a form in my code
<form class="validate form-horizontal" role="form" id="formLogin" action='actions.php' method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?php echo @$selectedUser['id'];?>" />
<input type="hidden" name="j" value="<?php echo "3"; ?>" />
<div class="form-group clearfix">
<div class="col-lg-offset-4 col-lg-9">
<button type="submit" class="btn btn-success"> Save </button>
<a class="btn btn-default" href="index.php">Cancel</a>
</div>
</div>
<div class="form-group clearfix">
<div class="col-lg-offset-4 col-lg-9">
<button type="submit" class="btn btn-success"> Approve </button>
<input style="margin-left: 10px;" type="checkbox" name="emailCheckBox" style="height: 25px">
<label style="margin-left: 10px;" class="control-label">Email Tami</label>
</div>
</div>
</form>
I have two different buttons here , Save and Approve.
There are atleast 7 more input fields in this form. Now i want it, so that when save button is clicked, it should send value of j = 3 and if Approve is pressed, it should send value of j to be 4
How can I override the form activity and maybe write some code in javascript to achive this, keeping in mind the data of other 7 etc input fields is being sent too, and its same for both buttons