ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Radio Group Validation

CyberWoolf 01 Sep, 2007
Hey Again!

I think I must have taken my stupid pill this week..

Ok.. so I install the latest chronos and love the validation tab. When I try to validate radio groups it still tells me the field is required even if I have selected an option.

This is my setup:

  <tr>
                         <td width="3%"> </td>
                         <td width="6%"><input name="radiomeal" type="radio" value="Yes"></td>
                         <td width="91%">Yes</td>
                    </tr>
                    <tr>
                         <td> </td>
                         <td><input name="radiomeal" type="radio" value="No"></td>
                         <td>No</td>
                    </tr>

In the validation tab I have 'radiomeal' as the option under 12- validate-one-required option.

I really appreciate this forum - the responses are quick and not mean!
GreyHead 01 Sep, 2007
Hi CyberWoolf,

I think there's a bug in the validation in 2.3RC1, as it makes any validated field required. Look in ChronoForms.php around line 131 and you'll find - class="required validate-one-required". Try changing this to - class="validate-one-required".

You might also need to read the help on the Really Simple Field Validation page (see url below) as I recall that this validation requires you to enclose the fieldset in <fieldset> or <div> tags.
To use the validate-one-required validator you must first add the class name to only one checkbox/radio button in the group (last one is probably best) and then place all the input elements within a parent element, for example a div element. That way the library can find all the checkboxes/radio buttons to check and place the validation advice element at the bottom of the parent element to make it appear after the group of checkboxes/radio buttons.
Bob

* http://www.tetlaw.id.au/view/javascript/really-easy-field-validation

Later: edited to add link and quote.<br><br>Post edited by: GreyHead, at: 2007/09/01 10:21
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com