HighDots Forums  

retreaving a value on method=Post

alt.html alt.html


Discuss retreaving a value on method=Post in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Paul
 
Posts: n/a

Default retreaving a value on method=Post - 06-14-2008 , 05:21 AM






This is not a pure html question but I can't get help anywhere on
this.

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
On">
I can't do this as <image> has no value="" in this case?

Desmond.



Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: retreaving a value on method=Post - 06-14-2008 , 07:51 AM






Scripsit Paul:

Quote:
input type="submit" name="submit" value="x"
input type="submit" name="submit" value="y"
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.

Quote:
I can sy on the next page
If ($_POST['submit'] == x)
That's PHP, right?

Quote:
but if I use

input type="image" name="LogOn" src="images/Submit.gif" alt="Log
On"
I can't do this as <image> has no value="" in this case?
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.:
http://fi2.php.net/manual/en/faq.htm...tml.form-image

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #3  
Old   
Paul
 
Posts: n/a

Default Re: retreaving a value on method=Post - 06-14-2008 , 01:43 PM



On Jun 14, 1:51 pm, "Jukka K. Korpela" <jkorp... (AT) cs (DOT) tut.fi> wrote:
Quote:
Scripsit Paul:

input type="submit" name="submit" value="x"
input type="submit" name="submit" value="y"

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.

I can sy on the next page
If ($_POST['submit'] == x)

That's PHP, right?

but if I use

input type="image" name="LogOn" src="images/Submit.gif" alt="Log
On"
I can't do this as <image> has no value="" in this case?

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.:http://fi2.php.net/manual/en/faq.htm...tml.form-image

--
Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
Thanks for that. Not the solution I would like but it will work.
Thanks again.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.