|
when this page loads i want the "name" input type field to automatically display the resuld of my cookie. if this page does not have a cookie set yet it shouldn't put anything in the field. when i use the script below, the cookies get set fine, and i can alert them when the page comes in, but the value will not show in the input field. when alerting alert(window.document.cart3form.name.value) the returned value is "undefined". anybody know how to get the unput field to enter right?
<form name="cart3form">
<script language="JavaScript" type="text/JavaScript">
alert(getCookie('name2')); // shows correct value of name2
window.document.cart3form.name.value = getCookie('name2');
alert(window.document.cart3form.name.value); // retuns "undefined"
document.write('<td width="60%" align="left"><input type="text" name="name" maxlength="40" size="31" onBlur="setCookie('+"'name2'"+', this.value)"> </td>');
</script>
</form>
|
|
|
|
|
|
|
|