i made a post a few weeks back about a problem that was troubling me.
the problem is/was that if i have a form with one text field and the user hits enter instead of the submit button, and im checking for the name of the submit button for processing, it wont work. im pretty sure this is because a one field form can be submitted by pressing the enter key without having any submit button at all. so even if there is a button, it gets ignored.
here is some proof for the skeptical who were convinced i was doing something wrong:
///////// CUT HERE ///////////////////
<?
echo $mytext1 . "<br>" . $mytext2 . "<br>";
if ($mysubmit)
echo "if ($mysubmit)<br>";
if(isset($mysubmit))
echo "if(isset($mysubmit))<br>";
if ($mysubmit != "")
echo "if(isset($mysubmit))<br>";
?>
<form action='<?=$PHP_SELF?>' method='post'>
<!--<input type='text' size=20 name='mytext1' value='<?=$mytext1?>'>
-->
<input type='text' size=20 name='mytext2' value='<?=$mytext2?>'>
<input type='submit' name='mysubmit' value='go'>
</form>
/////// STOP CUTTING /////////////
first hit enter with only one text field enabled, it dont work. enable the other field, hit enter in either one and viola! it works.
so unless im still doing something wrong, my solution to the problem is a hidden field. check for that and youll be all set...
paul