asmith Posted December 12, 2007 Share Posted December 12, 2007 i've got a user register page , where the form and the script are in one ile (i'm using $_SERVER[PhP_SELF]) when i fill the form and i press he enter button on keyboard the page would reload, and nothing would happen, even if i fill the page wrong, no error will be shown , but when i press my submit button on page by mouse , everything works fine, how can i fix the enter button on keyboard ? or disable it ? (without JAVA ) thanks Link to comment https://forums.phpfreaks.com/topic/81302-solved-enter-vs-submit/ Share on other sites More sharing options...
rajivgonsalves Posted December 12, 2007 Share Posted December 12, 2007 thats because you must be checking for submit button click if (isset($_POST['submit'])) to get around this put a hidden field in your form say <input type="hidden" name="submitted" value="submitted"> and then check if (isset($_POST['submitted'])) hope its helpful Link to comment https://forums.phpfreaks.com/topic/81302-solved-enter-vs-submit/#findComment-412630 Share on other sites More sharing options...
asmith Posted December 12, 2007 Author Share Posted December 12, 2007 yes that's true , i have that line, i didn't change anything, and just added the hidden input with the same name of the submit button , solved ! THANKS ! Link to comment https://forums.phpfreaks.com/topic/81302-solved-enter-vs-submit/#findComment-412631 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.