Forums

4.0 RC3.3 required field validation issue

libdesign 14 May, 2013
Hi Bob,
I have to make changes to a client's form making certain fields required.

First I enabled the JS Validation, then in the events area I structured my elements as follows:

On Load
- Auto Javascript Validation
- Load Captcha
- Show html (form uses custom code)
- Load JS (just some additional JS)

On Submit
- Check Captcha
- - On Success
- - - Handle Arrays
- - - Email
- - - Show Thanks Message
- - On Fail
- - - Event Loop

Upon form submit, only the Captcha will give an error if form was submitted without filling in the required fields.

I then went so far as to hard code the following validation code in my form html:

This is an example of the Name field in the form -- other required fields follow the same format.

<tr>
    <td align="right" width="200" class="bodytext">Name:*</td>
    <td width="250"><div class="ccms_form_element cfdiv_text" id="name_container_div" style="padding:0 0 0 5px;"><input name="name" type="text" id="name" style="width:250px; margin-left:-5px;" class=" validate['required']" /><div class="clear"></div><div id="error-message-name"></div></div></td>
	</tr>


I had done this for another client's form when I couldn't get the validation working.

Can you help me with this?

Thanks so much,
Adriana
GreyHead 14 May, 2013
Hi Adriana,

That all looks OK ( though I wouldn't use the Check Captcha On Success event). There's probably a JavaScript conflict with something else on the page. Please post a link to the form so I can take a quick look.

Bob
GreyHead 14 May, 2013
Hi libdesign,

The problem is with one or more of the three different versions of JQuery you have loading on the page. In the form without the template the validation works OK.

JQuery needs to be in noConflict mode to prevent it from breaking the MooTools code used by Joomla! and ChronoForms :-(

Please see this FAQ

Bob
This topic is locked and no more replies can be posted.