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..

Recommended Answers

All 5 Replies

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;


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?

Sory for my English..

Member Avatar for hiane.soufiane

you kan subit the form manually width javascript : document.forms["myform"].submit();

Paste your form html here.

Hmm... Necro post...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.