Results 1 to 2 of 2

Thread: Auto Save Form script- Radio button not saved

  1. #1
    Join Date
    Apr 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Auto Save Form script- Radio button not saved

    1) Script Title: Auto Save Form script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tosaveform.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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    HTML Code:
    <label><input type="radio" name="sex" value="male" />Male </label>
    or:

    HTML Code:
    <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'):

    autosaveform.js

    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.
    Last edited by jscheuer1; 04-24-2014 at 03:03 AM. Reason: add updated script
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Auto Save Form Values issue / enchancement
    By billbrach in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 08-02-2012, 04:16 PM
  2. Auto Save Form Processing Previous Form Submission
    By Meleo in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 07-09-2012, 04:38 AM
  3. Auto-totaling order form using radio buttons
    By monstrotanker in forum JavaScript
    Replies: 8
    Last Post: 09-03-2009, 07:10 PM
  4. One button to Save and Reset Form - Help
    By jpaulraj in forum JavaScript
    Replies: 1
    Last Post: 04-05-2007, 08:54 AM
  5. radio button form validation
    By gingerj in forum JavaScript
    Replies: 2
    Last Post: 04-06-2006, 06:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •