Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reload cookie in text field after reseting page

Status
Not open for further replies.

maynard444

Programmer
Jul 1, 2003
13
0
0
US
Does anyone know a way to reload a cookie into a text box after hitting a reset button on that form. The textbox is initially set to the value of the cookie when the page is opened. The reason I need a cookie to load the text is I am using a generic form template for data entry, there are certain areas that can be filled in automatically for different areas of operations. The problem I am having is that if the form is reset by the reset button it clears the textbox and wont reload the cookie. I understand that the form doesn't reload when the reset button is pressed, so I just need to know how I can reload the cookie when I press the reset, if it is possible.

Here is a sample of the code i am working with:
this is in the head:
<script>
var readcookie2=unescape(document.cookie);
</script>
this is in the body and form:

<input type=&quot;text&quot; name=&quot;Confirmation&quot;>
<script>
window.Form1.Confirmation.value=readcookie2;
</script>
then i have a normal reset button:
<input type=&quot;reset&quot; value=&quot;Reset&quot;>

Any info that you can spare would be appreciated.
Thanks,
maynard
 
How about this:

document.Form1.Confirmation.value=readcookie2;
document.Form1.Confirmation.defaultValue=readcookie2;

Adam
while(woman.width>woman.height && wallet.value>0){beer++;vision.blur()};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top