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

Link to comment
Share on other sites

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

Link to comment
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.