Question about stying "Required" fields - Vertical Radio and Checkboxes not working

trustinghim 01 May, 2014
I love the styling for "Required" fields found here: http://www.chronoengine.com/faqs/2702-how-can-i-identify-required-inputs.html

It works beautifully except for vertical radio and checkboxes.
You can see some tests at the bottom of the form (after the Submit button) here: http://fsbclajunta.com/2014-vbs-registration
All four of these fields are marked as "Required", but the two vertically styled ones don't have the "Required" styling.

Hopefully I can just add a simple bit of code, but I'm not sure what field name to use.

Thanks,
Teresa
trustinghim 02 May, 2014
I think I've found the problem, but I'm not sure what to do about it. The problem appears to be an extra "div" used for the vertical style.

This is the code for the horizontal Radio layout:
<label>Radio Test</label><input type="hidden" name="input_radio_31" value="" alt="ghost" />
<div style="float:left; clear:none;">
<input type="radio" name="input_radio_31" id="input_radio_31_0" title="" value="No" class="validate['required']" />
<label for="input_radio_31_0">No</label>
<input type="radio" name="input_radio_31" id="input_radio_31_1" title="" value="Yes" class="validate['required']" />
<label for="input_radio_31_1">Yes</label>
</div>


This is the code for the Vertical Radio layout:
<label>Radio Vertical Test</label><input type="hidden" name="input_radio_35" value="" alt="ghost" />
<div style="float:left; clear:none;"><div>
<input type="radio" name="input_radio_35" id="input_radio_35_0" title="" value="No" class="validate['required']" />
<label for="input_radio_35_0">No</label>
</div><div>
<input type="radio" name="input_radio_35" id="input_radio_35_1" title="" value="Yes" class="validate['required']" />
<label for="input_radio_35_1">Yes</label>
</div></div>


In the Vertical layout, "div" is used to place each option on a separate line ... and that "div" apparently prevents javascript from recognizing the "required" class.

In light of that, is there a simple way to specify or add a class to any given field in the form? If so, I could easily just add the "cf_required" class to those fields.
This topic is locked and no more replies can be posted.