Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- retreaving a value on method=Post
June 14, 2008, 10:21 am
rate this thread
if i have the following in my first page
<input type="submit" name="submit" value="x">
<input type="submit" name="submit" value="y">
I can sy on the next page
If ($_POST['submit'] == x)
but if I use
<input type="image" name="LogOn" src="images/Submit.gif" alt="Log
I can't do this as <image> has no value="" in this case?
Re: retreaving a value on method=Post
Even this is risky if you have a text input field in the form, too. What
happens when the user hits Enter in a text input field? Browsers may act
if a submit button (which? maybe a third one, anonymous) had been used.
Do you know which of the submit buttons the user _wanted_ to use?`
Conclusion: Use radio buttons for selecting an operation, and use just
one submit button. Or maybe two separate forms.
That's PHP, right?
You can't. Conclusion? Don't use image submit buttons. They're poor
usability anyway. They indicate that the designer thinks of his esthetic
preferences more than users' ease of use, including the recognizability
of buttons as buttons.
But if you decide to use an image submit button, and you use PHP, you
need to test for the existence of $POST[LogOn_x]. Ref.:
Jukka K. Korpela ("Yucca")