I realize that FireFox, Chrome, Safari, & Opera can limit the number of cookies a domain/website can set. So I thought of a different approach to storing my web forms many text, radio buttons, and select box values -Set a multi-variable cookie for each major section of the web form, instead of a separate cookie for each variable.
It would look something like this (inside each cookies content)...
firstName=John;&&;lastName=Andrews;&&;streetAddress=1234 Memory Ln.
What I'm looking for is a JavaScript function that will create/update this type of cookie on-the-fly properly (using element names instead of ID's for max compatibility with radio buttons) , triggered on each form elements 'onchange' event.
Then when needed, a function to load the cookie into a JavaScript string variable, parse the string for actual variables from between ';&&;' and load them into real JavaScript variables by the corresponding name, then when the user returns to the form the JavaScript fills in the values of the corresponding (by same name) form elements with these values, automatically.
Any help would be greatly appreciated.
Thanks in Advance!!
-James A.
FULL SOLUTION BELOW : Here is the complete 'save_form.js' code!
This is how you properly call these functions. Near the bottom of the HTML/PHP page containing the form, place this JavaScript respectively:
The next task is to see if all of this can be done without jQuery...hmm...