Jump to content

Recommended Posts

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. 

 

Link to comment
https://forums.phpfreaks.com/topic/229724-form-help-php_self/
Share on other sites

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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/229724-form-help-php_self/#findComment-1183403
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/229724-form-help-php_self/#findComment-1183405
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.