Get cookies on form load


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Get cookies on form load

  1. #1
    Join Date
    Jan 2004
    Location
    Alexandria, VA
    Posts
    392

    Get cookies on form load

    I have some javascript functions for getting/saving cookies. What I want to do is save all the values in the Input controls on the form to a cookie, and restore those values back into the form controls when the form is reloaded at some point in the future.

    I was going to put the javascript function calls into the form's onLoad() and onUnload() events, but apparently the "Form" tag doesn't support those events. I put them in the "Body" tag, but the onLoad() fails because the form portion hasn't loaded yet when the body onLoad() event fires.

    Any suggestions?

    Thanks...
    Bob Rouse
    Dimension Data

  2. #2
    Join Date
    Dec 2003
    Location
    tx/us
    Posts
    131
    The document.onload() event shouldn't fire until the page is fully loaded and rendering is complete.

  3. #3
    Join Date
    Jan 2004
    Location
    Alexandria, VA
    Posts
    392
    MAybe the problem is that I am using:

    Code:
    <Body onLoad="SetOperators(This)">
    It is saying that "this" does not exist. I've also tried:

    Code:
    <Body onLoad="SetOperators(This.FormName)">
    I need to pass a reference to the form. What am I doing wrong?

    Thanks...
    Bob Rouse
    Dimension Data

  4. #4
    Join Date
    Jan 2004
    Location
    Alexandria, VA
    Posts
    392
    Never mind... I just put the name of the form into the function call instead of "this".
    Bob Rouse
    Dimension Data

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center