dhimok Posted September 3, 2007 Share Posted September 3, 2007 anyone knows how to submit form with return key (IE)) It sounds more like a javascript question but if you know about it i would appriciate thanks Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/ Share on other sites More sharing options...
TutorMe Posted September 3, 2007 Share Posted September 3, 2007 On most forms, you can use the return key to submit, as long as you are not in a text-area I believe. Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-340837 Share on other sites More sharing options...
dhimok Posted September 3, 2007 Author Share Posted September 3, 2007 It doesnt work with internet explorer Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-340839 Share on other sites More sharing options...
TutorMe Posted September 3, 2007 Share Posted September 3, 2007 Hm. I'm on a mac, so I don't have IE, but I do know that I do not like IE for many reasons, mostly things similar to this. Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-340842 Share on other sites More sharing options...
Fadion Posted September 3, 2007 Share Posted September 3, 2007 Im on IE7 and i can submit forms with return. Anyway u can try this simple javascript to catch if the return key is pressed. I made it for a textarea to test it correctly. <textarea name="textfield" onkeypress="if(window.event.keyCode == 13){ form1.submit(); }"> Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-340879 Share on other sites More sharing options...
Jessica Posted September 3, 2007 Share Posted September 3, 2007 If you are using a certain type of submit button such as an image, I think IE has issues. If it is a regular button it will work outside of a textarea as others have said. Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-340887 Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 BUT not if you use <button or <input type="button". both of those are invalid for most buttons. If you want to do buttons that accept return you can always add a tab code to it. <input type="submit" value="submit" name="submit" acesskey="13"> You dont need acesskey, I just use it for acessability with program that people may use to show websites. Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-340891 Share on other sites More sharing options...
AndyB Posted September 4, 2007 Share Posted September 4, 2007 If you are using a certain type of submit button such as an image, I think IE has issues. Not quite. IE handles image submits in accordance with the HTML spec and returns the click coordinates. Other browsers under-perform. Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-340996 Share on other sites More sharing options...
markjoe Posted September 4, 2007 Share Posted September 4, 2007 I read that IE doesn't set the submit value when submitted with the return/enter key rather than the submit button. So it's more of an issue of handling the submission. When checking input, I check for the actual input fields, not the submit value. On a couple pages that have multiple forms, I will sometimes have a hidden field that I set and check for. Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-341008 Share on other sites More sharing options...
Fadion Posted September 4, 2007 Share Posted September 4, 2007 I read that IE doesn't set the submit value when submitted with the return/enter key rather than the submit button. So it's more of an issue of handling the submission. When checking input, I check for the actual input fields, not the submit value. On a couple pages that have multiple forms, I will sometimes have a hidden field that I set and check for. Its true. Submit value will pass to post or get only if one presses it with mouse. I either check for input fields instead of submit. Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-341025 Share on other sites More sharing options...
AndyB Posted September 4, 2007 Share Posted September 4, 2007 Submit value will pass to post or get only if one presses it with mouse. Isn't that exactly what a good browser would do? Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-341050 Share on other sites More sharing options...
d22552000 Posted September 4, 2007 Share Posted September 4, 2007 the funny part is it ONLY does this if you give the submit button the "name" field or the "value" field. A submit button BAREBONE IS: <input type="submit"> this will show a standard button that says submit (and old browsers show a nice clickable rectangle with no text in it) only if you have name="submit" or value="submit" will it pass ?submit or ?submit=submit to a POST or GET var. I tried foreach on post to benchtest these and I got it says submit as a result only when name and value are given. Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-341065 Share on other sites More sharing options...
Fadion Posted September 4, 2007 Share Posted September 4, 2007 Isn't that exactly what a good browser would do? Probably yes. Quote Link to comment https://forums.phpfreaks.com/topic/67817-submit-form-with-return-key/#findComment-341066 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.