kayz100 Posted August 15, 2013 Share Posted August 15, 2013 Hi guys, I have two forms on one php page, the forms work fine if they are on different pages but I want both of them on one page to make my registration/login page look trendy and modern. However, I have come to an abrupt halt as the two forms fail to execute. One works fine and the other is ignored completely. How do I get both of them executing at different intervals even though they are on one page? I think I have a problem on the 'return false'. The registration form works fine but the login form is failing to work. I have two different ajax for processing this form please help. code of forms below, thank you. Some members suggested I try <input type="submit" /> but still no luck using input attribute. Please help //FORM 1 <div> <p style="text-align:center;;">REGISTRATION FORM</p> <form name="rgistrationform" id="registration" onsubmit="return false;"> <div>Username: </div> <input id="username" type="text" /> <div>Email:</div> <input id="email" type="text" /> <div>Enter Password:</div> <input id="pass1" type="password" /> <div>Repeat Password:</div> <input id="pass2" type="password" /> <br /> <button id="registerbtn" onclick="register()">Register</button> <br /> </form> </div> //FORM 2 <div> <h3 style="text-align:center;">LOGIN FORM</h3> <form id="loginform" onSubmit="return false;"> <div>Email Address:</div> <input type="text" id="email" /> <div>Password:</div> <input type="password" id="password" /> <br /><br /> <button id="loginbtn" OnClick="login()">LOG-IN</button> <br /> <a href="4gotpass.php"><strong>Forgot Password</strong></a> </form> Quote Link to comment https://forums.phpfreaks.com/topic/281205-onsubmit-return-false/ Share on other sites More sharing options...
PaulRyan Posted August 15, 2013 Share Posted August 15, 2013 You have OnClick on the buttons within the form, please post those functions. I'm assuming they submit the form, but when the form is submitted, you are returning false which cancels the submit action. Quote Link to comment https://forums.phpfreaks.com/topic/281205-onsubmit-return-false/#findComment-1445178 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.