MDanz Posted March 6, 2011 Share Posted March 6, 2011 i have a form on submit.php, with method post to the same page($PHP_SELF). If i made a mistake i want to be able to go back to the previous page(same page) and have the values in their textfields. if(isset($_POST['new'])) { <a href='#' onClick='history.go(-1)'>Go Back</a> } else { // code } The problem is.. it goes back to the page as planned and then it changes page to submit.php#. the previous page was submit.php?search=test. Quote Link to comment https://forums.phpfreaks.com/topic/229724-form-help-php_self/ Share on other sites More sharing options...
Pikachu2000 Posted March 6, 2011 Share Posted March 6, 2011 What does the form in question do? Does it generate a database insert, or . . . ? Quote Link to comment https://forums.phpfreaks.com/topic/229724-form-help-php_self/#findComment-1183401 Share on other sites More sharing options...
MDanz Posted March 6, 2011 Author Share Posted March 6, 2011 the form is made up of text fields, with a button to add more textfields done with javascript. So i need the onclick='history.go(-1)', to have the newly added textfields displayed when the user goes back. the onclick='history.go(-1)' is needed so if the user has went above the word count they can go back and change the values and re-submit, then the values are inserted into a database. Quote Link to comment https://forums.phpfreaks.com/topic/229724-form-help-php_self/#findComment-1183403 Share on other sites More sharing options...
Pikachu2000 Posted March 6, 2011 Share Posted March 6, 2011 So this is really more of a javascript question then, since you'd have to submit the form to have php do anything with it. I'm afraid that when you go much further than alert() in javascript, I'm pretty much useless. I'll move the thread to the javascript forum though, since that seems to be the right place for it. Quote Link to comment https://forums.phpfreaks.com/topic/229724-form-help-php_self/#findComment-1183405 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.