rasherb Posted December 18, 2007 Share Posted December 18, 2007 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 More sharing options...
The Little Guy Posted December 18, 2007 Share Posted December 18, 2007 AJAX.. You will need to pass the info using javascript to a php file. Link to comment https://forums.phpfreaks.com/topic/82229-solved-pass-javascript-variable-to-php/#findComment-417886 Share on other sites More sharing options...
chigley Posted December 18, 2007 Share Posted December 18, 2007 Why do you need to refresh the page?? :S Link to comment https://forums.phpfreaks.com/topic/82229-solved-pass-javascript-variable-to-php/#findComment-417888 Share on other sites More sharing options...
rasherb Posted December 18, 2007 Author Share Posted December 18, 2007 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 https://forums.phpfreaks.com/topic/82229-solved-pass-javascript-variable-to-php/#findComment-417889 Share on other sites More sharing options...
rasherb Posted December 18, 2007 Author Share Posted December 18, 2007 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. Link to comment https://forums.phpfreaks.com/topic/82229-solved-pass-javascript-variable-to-php/#findComment-417891 Share on other sites More sharing options...
emehrkay Posted December 18, 2007 Share Posted December 18, 2007 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 https://forums.phpfreaks.com/topic/82229-solved-pass-javascript-variable-to-php/#findComment-417892 Share on other sites More sharing options...
rasherb Posted December 18, 2007 Author Share Posted December 18, 2007 Well, time to learn some javascript... Thanks all! Link to comment https://forums.phpfreaks.com/topic/82229-solved-pass-javascript-variable-to-php/#findComment-417903 Share on other sites More sharing options...
emehrkay Posted December 18, 2007 Share Posted December 18, 2007 Well, time to learn some javascript... Thanks all! This wont be too difficult , make a post in the js forum and we'll help you out Link to comment https://forums.phpfreaks.com/topic/82229-solved-pass-javascript-variable-to-php/#findComment-417905 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.