I have 3 buttons on my form, two which are submits (Confirm and Modify) and one which is just a button for cancel (and a subsequent onClick script when it is clicked).
Currently, there is a piece of code that does the following:
Code: Select all
echo "<form name='achievement_modify' method='post' onSubmit='return check_num();' action='".$_SERVER['PHP_SELF']."'>";One solution I suppose I came up with, but I am not sure if it works, is that I do the modify button similarly to the cancel button and have it run its own onClick script but I am not sure how to write that script such that I can retain all the data like how the current "action='".$_SERVER['PHP_SELF']."" does it in the post array.
A second solution which I am trying to determine if possible is to make the check_num script check if it knows which button was submitted, so it can just return true if it is the modify one, else do the checks if it is confirm one. However again, I am not sure how to do this.
Anyone have any idea on how I can do this? I am not the original author of this code, I just volunteered to help with something for some acquaintances, that's why I seem to be asking questions about things that I should be able to solve if I wrote this code.
Thanks.