codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  form input values, cookies  flashgroover at 22:39 on Monday, October 27, 2003
 

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>








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Use of VB .NET
•  Cookies and new pages
•  need help with e-mail validation
•  Problems with DHTML dropdown menus
•  Re: Passing values from a select box to a text box
•  lowerCase to UpperCase
•  Re: Javascript validation that will stop a ` (apostrophe) being entered
•  Re: pop-up Javascript calendar
•  nested classes


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005