Reputation: 25557
I know, this might be a very basic question but I am not 100% sure on the topic.
When submitting forms, is there a precise value that needs to be passed in order to inform that a certain button was pressed...
or can any value be passed in relation to the submit button's name?
Any ideas?
Edit:
Thank guys! I found out how to deal with the problem.
As variables are passed to the servers and are pretty much open to interpretation, depending on how they are read by the server,
I just decided to check the data being posted on various forms and just decided to mimic them.
Everything works now, thanks for your help!
Upvotes: 2
Views: 410
Reputation: 382696
You could pass any value and you can check based on various possibilities whether form was submitted. For example, this is how we check in php whether or not form was submitted:
<input type="submit" name="submit" value="whatever" />
if (isset($_POST['submit']))
{
// form was submitted !!
}
Upvotes: 2
Reputation: 887443
You should pass the <input type="submit">
's value
attribute.
For example, if the user clicks the following submit button, the browser must send GoNext=Next+Step
<input type="submit" name="GoNext" value="Next Step" />
For more information, read the specification
Upvotes: 1