I think this is a esay solution for this. Make Previous button type
to button
, and a new add onclick
attribute in button with value jQuery(this).attr('type','submit');
.
So, when the user clicks on the Previous button then its type
will be changed to submit
and the form will be submitted with Previous button.
<form>
<!-- Put your cursor in this field and press Enter -->
<input type="text" name="field1" />
<!-- This is the button that will submit -->
<input type="button" onclick="jQuery(this).attr('type','submit');" name="prev" value="Previous Page" />
<!-- But this is the button that I WANT to submit -->
<input type="submit" name="next" value="Next Page" />
</form>