Tim Ward wrote:
> 
Be careful using values of submit buttons ... if the user hits return
instead of clicking one of the buttons you won't get anything. If you want a
default value try a hidden field before the submits with same name.
> 

Tim, thanks for the tip. I had heard of this behavior before, but never
witnessed it. Today I wrote a test form with 1 text field and 1 submit, and
it did do this: when I submitted via return, the submit field was not
posted. However, when I added a second text field to the form, the submit
did get posted. I was careful that the focus was still in the text field,
and not on the button, when I hit return.

Any ideas on why this inconsistency? Just curious. Since it is inconsistent,
your point is important and well-taken.

My code is below if anyone wants to play.

Kirk

submit.php
----------
<HTML><HEAD></HEAD><BODY>
<FORM ACTION="submitRun.php" METHOD="POST">

<INPUT TYPE="text" name="test"><br>
<!--<input type="text" name="test2"><br>-->

<!--<INPUT TYPE="hidden" name="submit" value="Yes">-->
<INPUT TYPE="SUBMIT" name="submit" value="Yes">
<INPUT TYPE="SUBMIT" name="submit" value="No">

</FORM></BODY></HTML>

submitRun.php
-------------
<?
while(list($key,$val)=each($HTTP_POST_VARS)) {
  echo "key $key = $val <br>";
}
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to