[Javascript] Automated Reload

Peter-Paul Koch gassinaumasis at hotmail.com
Sat Jun 9 08:41:59 CDT 2001



>    I have a problem along this line as well. I have a page that allows 
>users to update a field in a database. When the field has been updated the 
>user is sent back using the history.back(); function. When they are sent 
>back i want a hidden form to submit so it will refresh the page, with the 
>updated information.

I think it's easier to submit the form to the same page, where a script 
first stores the input in the database and then prints the HTML page, 
including the new info. This way you don't have these complex refresh 
problems.

In fake syntax:

<server side script>
if (form submitted)
{
store value in databse
}

print "Content-type: text/html\n\n";
print "<HTML>etc.";
print "<FORM METHOD=POST>"; // no ACTION, submits to itself
print "<INPUT VALUE="<% get from database %>">";
</server side script>

If the user doesn't submit the form (if he enters the page through a normal 
link) he sees the old value, if he submits the form he sees the new value.

ppk

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





More information about the Javascript mailing list