2

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!

1
  • Are you trying to build a browser or a server? Commented Apr 19, 2010 at 11:48

2 Answers 2

2

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 !!
}
Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.