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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cookies and forms

Status
Not open for further replies.

cesarcesar

Programmer
Mar 5, 2003
30
hello all, my problem is that i would like to set the value of a test field to the value of a variable i got from a cookie. when the page loads and there is no cookie value set i assume that the value should come in null. if there is a cookie value set, then i would liek the text feilds value to be that. am i correct in this thought pattern? this is the dcript i have so far below. i get an error when the page loads,
onChange="setCookie('name', this.value)
at this line i get an error that i am missing a ")" around 'name'.
can anybody solve this perplexing problem? kudo's to those that can, help me please!!

<form action='WSmainframe.php' method='GET' target='mainframe' name='cart3form'>

<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>

var name2 = getCookie('name');
window.document.cart3form.name.value = name2;
alert(window.document.cart3form.name.value);

document.write('<td width=&quot;60%&quot; align=&quot;left&quot;><input type=&quot;text&quot; name=&quot;name&quot; maxlength=&quot;40&quot; size=&quot;31&quot; onChange=&quot;setCookie('name', this.value)&quot;> </td>');

</script>
</form>
 
Hi

Try this:

document.write('<td width=&quot;60%&quot; align=&quot;left&quot;><input type=&quot;text&quot; name=&quot;name&quot; maxlength=&quot;40&quot; size=&quot;31&quot; onChange=setCookie(&quot;name&quot;,this.value) > </td>');

I think its basically a quotation mark problem.

Modalman

ASCII silly question, get a silly ANSI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top