PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Multiple Choice and Checkboxes not setting defualt values

  1. Hi, I'm having issues with getting the Multiple Choice input fields on my form to set default values.

    Everything within the Form Editor appears to work as it should, I can set which choice I would like to have as the default value and it appears to set it correctly within the Form Editor, but once I update the form and view it with in the Form Previewer or on an actual page, the Multiple Choice fields do not have the default fields selected that I set in the Form Editor.

    Here is a link to the form that I'm using:
    http://pastebin.com/mdpewCS4

    Posted 13 years ago on Tuesday January 11, 2011 | Permalink
  2. I checked out the form you sent over and the only field I found with a pre-selected value was this one: http://grab.by/8kdo

    As you can see, it is pre-selected in both the admin and when viewed in the preview mode. When you preview your form are you receiving any JS errors?

    Posted 13 years ago on Tuesday January 11, 2011 | Permalink
  3. I was actually referring to any of the "radio" input fields, so fields with the id's 6, 8, 24, 60, 67. When I exported the form, they were set with default/preselected values from the "Form Editor", so I'm not sure why they are not showing up when you export/import the form, maybe thats part of the issue I am experiencing.

    I monitored the JavaScript with firebug as I went through the process and the console did not report any errors, I did however notice that the radio buttons that I try to set as defaults have the code 'selected = "selected" ' within the input tags. The W3C standard for setting the default state of a radio button is 'checked = "checked", so maybe that could be a part of the issue.

    For what it's worth I am currently running Version 1.5.rc2.5, and i also checked it in the latest release Version 1.5.rc3.2 . I Also found that the default selecting of the radio buttons with the form works in the current public release, Version 1.4.5

    Here is a fresh copy of the form
    http://pastebin.com/CwfsDGey

    Posted 13 years ago on Wednesday January 12, 2011 | Permalink
  4. I am having the same problem with 1.5.rc2.5 and radio buttons not setting to their defaults because selected = "selected" is being used instead of checked = "checked".

    Any idea where in the plugin I can update this to output the correct 'checked' attribute? I can't update the plugin due to mods I have made to it

    Posted 13 years ago on Wednesday February 9, 2011 | Permalink
  5. @davemac I have tested this in 1.5rc4 and radio buttons are maintaining their default values when I set one when I edit a multiple choice field. This was an issue with the earlier plugin.

    What have you modified in 1.5rc2.5 that is preventing you from upgrade? Modifying core code isn't recommended for this reason, it's why we have hooks/filters to customize the plugin without modifying core code... by not upgrading you are missing a lot of fixes/changes between rc2.5 and rc4 and there have been a lot.

    Posted 13 years ago on Wednesday February 9, 2011 | Permalink
  6. The issue was in common.php where selected = "selected" was being used instead of checked = "checked" for radio button. So I modified that code.

    I had a look at the documentation, but not sure how I could have overridden this with a hook or a filter? Happy to be pointed in the right direction if I am wrong.

    Posted 13 years ago on Friday February 11, 2011 | Permalink
  7. There isn't a filter/hook for this. But this issue is already fixed in the 1.5 RC4 release so if that was all you modified, you should have no problem upgrading to 1.5 RC4 because that fix is already in place.

    Posted 13 years ago on Friday February 11, 2011 | Permalink