954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

[ask] Redirect page but keep form's data

Hi..
Is it possible to redirect the page with javascript but keep the data alive and can be read or used by the destination page?
I use PHP scripting..

eantz
Light Poster
29 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

So you have a page that has a form, a second page that redirects to third, and a third page that handles the data?

Why don't you just implement the third page into the second? Or just change the action="" attribute in the form to the third page?

I don't understand why you want to redirect the page...?

You could also do the following (the data is transferred via url):

<script type="text/javascript">
function redirect() {
var somedata = document.form1.somedata.value;
var url = "http://example.com/page.php?somedata=" + somedata;
}
</script>


~G

Graphix
Posting Pro in Training
432 posts since Aug 2009
Reputation Points: 82
Solved Threads: 74
 

Okay, I'll explain it..
I have a page with a form, when I submit the form, I validate it via jQuery ajaxSubmit. Then when I return it to 'true", the form won't submit itself physically. So, It try to redirect it from javascript. But, it doesn't work well. The page can be redirected but the destination page can't read the data. In the other word, the form can't be submitted when I redirect the page..
So, is it possible to make the data readable by the destination page when I redirect it via javascript?

Thanks,
Sory for my English..

eantz
Light Poster
29 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You