/    Sign up×
Community /Pin to ProfileBookmark

Hit enter to submit?

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:

[code=php]
<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>[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ToonMarinerFeb 10.2007 — 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...
Copy linkTweet thisAlerts:
@Hendrick2authorFeb 10.2007 — 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.
×

Success!

Help @Hendrick2 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...