View Full Version : Auto Save Form script- Radio button not saved

04-23-2014, 06:52 PM
1) Script Title: Auto Save Form script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex16/autosaveform.htm

3) Describe problem: Radio buttons are not being saved when I include an id attribute. I need the id attribute to reference the label for the radio button.

04-23-2014, 08:56 PM
Your're right. But I can't figure it out, but you're wrong about one thing. You don't need an id for a label, at least not in IE 7 or 8 + and not in any other modern browser. You can just include the element inside the label, ex:

<label><input type="radio" name="sex" value="male" />Male </label>


<label>Male <input type="radio" name="sex" value="male" /></label>

It will act just like a for/id pair and the script will work just fine.

I was playing with it a bit more, and this tweaked version seems OK with for/id labels and radio buttons (right click and 'Save As'):


The browser cache may need to be cleared and/or the page refreshed to see changes.

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.