moose-en-a-gant Posted February 10, 2015 Share Posted February 10, 2015 I have a three part form, for creating a user, then I want to push a button that switches to a login without refreshing the page and log in. The three parts are username, email, password I push the login button instead of the create user button and this removes the email input Now instead of the submit button displaying "Create User" it displays login, I have two differnt action values in my php but when I hit the submit button, it only does the Create user action. So is it not possible to do what I want? Here are some parts of code that should surmize what I'm getting at. I'll try to do it in the same order if($_SERVER['REQUEST_METHOD']=='POST'){ if(empty($errors)){ if(isset($_POST['submit'])){ $action = $_POST['submit']; if($action=='create user'){ }else if($action=='Login'){ } } } <script> $(document).ready(function(){ $("button").click(function(){ $("#div2").remove(); $("#div3").val("Login"); $("#btn1").remove(); }); }); </script> <input type="submit" id="div3" name="submit" value="create user"> Quote Link to comment https://forums.phpfreaks.com/topic/294488-i-cant-change-the-value-of-a-submit-button-and-have-a-different-post-result/ 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.