skliz4rel Posted February 1, 2013 Share Posted February 1, 2013 Hello every body, I am posting a form to an IFrame with my submit button. But I want to enable it to work with enter button. though I was able to do it on IE9 and other browsers but it does not work on IE7 or IE8 plse does anybody have a script that would work on IE7 and IE8. Quote Link to comment https://forums.phpfreaks.com/topic/273905-using-enter-button-to-instantiate-a-form-post/ Share on other sites More sharing options...
Adam Posted February 1, 2013 Share Posted February 1, 2013 Can you provide the code you used? I remember IE7/8 were a bit funny about which events listen were triggered for different keys. Quote Link to comment https://forums.phpfreaks.com/topic/273905-using-enter-button-to-instantiate-a-form-post/#findComment-1409531 Share on other sites More sharing options...
skliz4rel Posted February 2, 2013 Author Share Posted February 2, 2013 $('#message').bind('keypress',function (e){ if(e.keyCode == 13){ //This line would check if the enter key was pressed var message = $('#message').val(); message = $.trim(message); return true; }); }); For IE7 OR IE 8 the code enters the if statement but it does not send the message Quote Link to comment https://forums.phpfreaks.com/topic/273905-using-enter-button-to-instantiate-a-form-post/#findComment-1409691 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.