Any ideas on what's wrong?
This kind of behaviour usually suggests there's some malformed html-code in your form code. You could try disabling the checkToken security feature (form settings, general tab), and see if that helps.
/Fredrik
Why is it so difficult to do?
Here is my html code:
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">name</label>
<input class="cf_inputbox required" maxlength="150" size="30" title="enter name" id="text_0" name="text_0" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Email</label>
<input class="cf_inputbox required validate-email" maxlength="150" size="30" title="enter email" id="text_1" name="text_1" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_2" type="submit" />
</div>
<div class="cfclear"> </div>
Enable validation: Yes:
Validation Library: Mootools
Run Validation onlyOnSubmit:Yes
1 - required (not blank) : text_0,text_1
7- validate-email (a valid email address): text_1
When i started using Chronoform, i was thinking that just check "required" in the form wizard was enough.. i think it should be, don't you think ?
Any suggestion?
This kind of behaviour usually suggests there's some malformed html-code in your form code. You could try disabling the checkToken security feature (form settings, general tab), and see if that helps.
I don't see any problems in my HTML and turning of the checkToken didn't change anything, but thanks for the suggestions, Fredrik.
Here's my HTML for my contact us form
<div class="contentpaneopen-form">
<div class="contentheading">
Contact Information
</div><br />
<div>
<span style="float: right"><b>2020 S. Oneida Street, Suite 100<br />
Denver, Colorado 80224</b><br />
<br />
Phone: (303) 759-4800<br />
Fax: (303) 759-0509<br />
<br /></span>
<img src="/images/stories/mtnview_map.gif" /><br />
<br />
<small><a href="http://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=2020+S.+Oneida,Denver,+Colorado+80224+&sll=37.0625,-95.677068&sspn=56.112526,95.449219&ie=UTF8&hq=&hnear=2020+S+Oneida+St,+Denver,+Arapahoe,+Colorado+80224&z=17&ll=39.680006,-104.907781" style="text-align:left">View Interactive Map on Goggle and to Get Directions</a></small> <br />
</div><br /><br />
<div class="contentheading">
Contact Us
</div><br />
<div class="required">
Fields labeled in tan are required.<br /><br />
First Name: <INPUT NAME="first-name" SIZE=30 maxlength=68><br /><br />Last Name: <INPUT NAME="last-name" SIZE=30 maxlength=68><br /><br />
Email Address: <INPUT NAME="email-address" SIZE=30 maxlength=68><br /><br />
Phone Number: <INPUT NAME="phone-number" SIZE=20 maxlength=68><br /><br />
</div>
<div>
Street Address: <INPUT NAME="street-address" SIZE=30><br /><br />
City: <INPUT NAME="city" SIZE=30><br /><br />
State: <INPUT NAME="state" SIZE=5> Zip Code: <INPUT NAME="zip-code" SIZE=15 maxlength=10><br />
<br />
</div>
<div class="required">
What is the nature of your inquiry?
</div>
<div>
<INPUT TYPE="checkbox" NAME="inquiry-nature" VALUE="Prescription_refill">Need a prescription refill <br />
<INPUT TYPE="checkbox" NAME="inquiry-nature" VALUE="General_question">General office question<br /><br />
Comments:<br />
<TEXTAREA NAME="Notes" ROWS="6" COLS="60"></TEXTAREA>
</div><br /><br />
<div class="required">
Please enter the security code in the field below.
</div><br />
<div>
{imageverification}<br />
<input type='submit' value='Submit Form'> <INPUT TYPE="reset" VALUE="Reset">
</div>
</div>
The odd thing is that the form requires me to choose one of the checkboxes but it doesn't require any of the "required" fields even though their names are in the required field on the validation tab.
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_2" type="submit" />
</div>
<div class="cfclear"> </div>
I do notice that you've got dashes in your form field names, these tend to cause various issues with forms and php. Also, when using multiple checkboxes with the same name, make sure it's an array (suffix the name with []).
Finally, which I believe is the main source for your issues with validation, is that your form lacks the type-property for all inputs except the checkboxes and submit-button.
Hi abriko,
Could you post a link to the site/form?
/Fredrik
As for the checkboxes, by suffixing the name do you mean name="inquiry-nature[]" or am I not understanding.
Thanks again for you help!
yes, please add the [] to teh field name and replace the - by _
Regards
Max
http://ftp20091101.38.71china.com/index.php?option=com_chronocontact&chronoformname=form_test
And yes, i have a </div> to close my main from div.
Your page does not load the various javascript libraries needed for the validation, in fact, it loads no scripts at all. However, if you load the script without the template (add &tmpl=component to the end of the link - http://ftp20091101.38.71china.com/index.php?option=com_chronocontact&chronoformname=form_test&tmpl=component) and you'll see the validation working just fine.
As such, this would appear to be an issue with your template.
/Fredrik
I think i need to learn a little more templating joomla ^^
Tank you very much for your help !
The debug mode should tell something about it, don't you think ?