Last modified: 2010-01-08 17:59:04 UTC
Created attachment 6921 [details] Patch adds ID to radiobutton field for use with validation If you set a mandatory tag for a radiobutton field in version 1.8.6, will always fail javascript validation returning "cannot be blank". I don't know why this worked in versions prior to 1.8.6, but stopped working there. If you do not have the tag "mandatory" in a field definition, will also allow selection "none". If you add the mandatory validation, will never validate. Patch attached that will fix this problem. Example: {{{field|Client Status|input type=radiobutton|property=Client Status|default=Pending|mandatory}}} -- Property Definition -- Property:Client Status This is a property of type [[Has type::String]]. It links to pages that use the form [[Has default form::Active Participants List]]. The allowed values for this property are: * [[Allows value::Pending]] * [[Allows value::Active]] * [[Allows value::Inactive]] * [[Allows value::Rejected]] -- HTML Generated in broken version -- <span class="mandatoryFieldsSpan"> <input type="radio" tabindex="2" name="Active_Participants_List[Client Status]" value="Pending" /> Pending <input type="radio" tabindex="2" name="Active_Participants_List[Client Status]" value="Active" checked="checked" /> Active <input type="radio" tabindex="2" name="Active_Participants_List[Client Status]" value="Inactive" /> Inactive <input type="radio" tabindex="2" name="Active_Participants_List[Client Status]" value="Rejected" /> Rejected </span> <span id="info_2" class="errorMessage"></span> -- Javascript validation generated -- if (! validate_mandatory_checkboxes('input_2', 'info_2')) num_errors += 1; In validate_mandatory_checkboxes, field "input_2" will never be found, so will return validation error. -- Proposed fix will generate following HTML -- </th><td colspan="5"> <span class="mandatoryFieldsSpan"> <input type="radio" id="input_2" tabindex="2" name="Active_Participants_List[Client Status]" value="Pending" /> Pending <input type="radio" id="input_2" tabindex="2" name="Active_Participants_List[Client Status]" value="Active" checked="checked" /> Active <input type="radio" id="input_2" tabindex="2" name="Active_Participants_List[Client Status]" value="Inactive" /> Inactive <input type="radio" id="input_2" tabindex="2" name="Active_Participants_List[Client Status]" value="Rejected" /> Rejected </span> <span id="info_2" class="errorMessage"></span>
*** Bug 22013 has been marked as a duplicate of this bug. ***
This was actually a somewhat different bug, but it's been fixed in version 1.8.7.