Jump to content

[SOLVED] pass Javascript variable to PHP


rasherb

Recommended Posts

I really want reload a page I have with a huge form on it without losing any information users have typed into the form. Can php access form data before the form is submitted like javascript (document.form.name.value)?

 

Any other ideas for keeping form data on refresh without submitting the form?

 

Any help would be much appreciated!

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/82229-solved-pass-javascript-variable-to-php/
Share on other sites

Thanks,

So if I use a link to refresh the page...

 

<?php

echo "<form name=\"form\" method=\"post\" action=\"submit.php?useridnum=$usernum\">";

echo "Title: <input type=\"text\" name=\"title\" size=\"70\"></textarea>";

 

echo "<a href=\"";

echo $_SESSION['PHP_SELF'];

echo "?show=1\"><img border=\"0\" src=\"close.gif\"></a>";

?>

 

Where would the java go?

The form has sections (it's huge) I use links and if(isset){} to expand and contract the sections so they are not all on the page at once, confusing the heck out of users.

 

use multiple pages and process on each page, what you are describing is a confusing way to handle it. or use javascript to show/hide certain areas of the form

Archived

This topic is now archived and is closed to further replies.

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