Click to See Complete Forum and Search --> : Hit enter to submit?


Hendrick2
02-10-2007, 11:12 AM
This is either PHP or HTML, so sorry if I'm in the wrong section.

I have this little shoutbox script that I made. Hitting enter after you type in your message works fine in FF. However, in IE, you have to move your mouse over to the submit button, you can't just use enter. Anyone know how to make that work?

I doubt this helps, but just incase:

<form action="index.php" method="post" name="shout">
<input type=text name=comment size=40 class='forminput' value=''>
<input type=hidden name=bu value='<?php echo $user ?>'>
<input type=hidden name=ub value='<?php echo $board ?>'>
<input type=submit name=submit value='Submit'>
</form>

ToonMariner
02-10-2007, 11:22 AM
browser specific. It used to be only IE that woud auto submit a form on pressing enter. I wouldn't try to over rule teh default behaviour of a browser in this respect - people will be used to what they must do to submit on their own browser. If you paced any javascript in in would probably have to be on the onkeypress event of the body - and what if you have 2 forms in a page? what happens if both get submitted?

Leave it as is - les work for you and no surprises for your users...

Hendrick2
02-10-2007, 01:14 PM
IE has dropped this feature, and FF has picked it up. I only have one form on my page too, so I wouldn't have the issue on which one would have to submit.