contra10 Posted March 12, 2009 Share Posted March 12, 2009 im trying to allow the user to hit enter from the keyboard instead of moving the cursor to the button and clicking submit <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="text" name="status" maxlength="30"> <br> <input type="image" value="Update" name="submit" src="cooltext415698324.png" onmouseover="this.src='coolMouseOver.png';" onmouseout="this.src='cool.png';" /> thats my submit button Quote Link to comment Share on other sites More sharing options...
contra10 Posted March 12, 2009 Author Share Posted March 12, 2009 is this a javascipt problem like should i use onclick Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 12, 2009 Share Posted March 12, 2009 i dont get what your asking but you should check into Jquery Validation plugin Quote Link to comment Share on other sites More sharing options...
corbin Posted March 12, 2009 Share Posted March 12, 2009 If the user hits enter in a text field, it usually automatically submits the form in most browsers. darkfreaks, excuse my bluntness here, but did you write the jQuery Validation Plugin or something? Seems like 95% of the JS posts you write you push it on the OP. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 12, 2009 Share Posted March 12, 2009 um no i was just trying to offer an alternative solution to the OP so excuse me anyhow i dont see the point in doing it as it auto submits on enter anyhow *shrug* Quote Link to comment Share on other sites More sharing options...
corbin Posted March 12, 2009 Share Posted March 12, 2009 Hrmm was just curious. Quote Link to comment Share on other sites More sharing options...
contra10 Posted March 12, 2009 Author Share Posted March 12, 2009 but if my submit is input type "image" cause im using an image instead of a submit button could it work Quote Link to comment Share on other sites More sharing options...
Psycho Posted March 12, 2009 Share Posted March 12, 2009 The Submit element has no bearing on whether the enter key will work to submit the form. As long as the has focus on some types of fields, the form will be submitted using the enter key. With focus on Text, Radio, and Checkbox fields the enter key will submit the form. A textarea will, of course, not submit the form. Neither does a select list (at least not in IE) not sure why that wouldn't work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.