Forums

How do I enable the validation of the form?

riga75 08 Jun, 2011
I created a custom form but I do not understand how to ensure that there is validation in the various fields.
Who can help me?
Thank you very much


stefano
GreyHead 08 Jun, 2011
Hi stefano,

There are a series of checkboxes on the Validation tab in the Wizard Element configuration. Or you can add the classes directly to Custom Form HTML e.g. class="validate['required','email']

Bob
riga75 08 Jun, 2011
Hello Bob and thank you for your response but I have a form created by me and not through the wizard.
And I did not understand where should I put this code class = "validate ['required ', 'email']
I entered the edit form by clicking on Wizard and then what should I do?
thank you very much


stefano
GreyHead 08 Jun, 2011
Hi stefano,

Click on the Form Name link in the forms manager, then the Code tab and you can add the classes to the Form HTML from there.

There isn't an automated way to add validation to a custom form at the moment.

Bob
riga75 09 Jun, 2011
Ciao Bob, grazie ancora della tua infinita pazienza ma ho un problema.
Ho inserito questo codice:
 <td><input type="text" class="validate['required','email']" name="Email" />*</td>

e la pagina è questa:http://www.escogitoprogetto.it/index.php?option=com_chronoforms&chronoform=ArredoAbitazione1
ma sembra che non funzioni, dove sbaglio?
Grazie
GreyHead 09 Jun, 2011
Ciao stefano,

The problem is the RocketTheme script compressor RokGZipper; it is beta code and breaks the scripts that ChronoForms needs. Please turn it off.

Note: This plugin is experimental and should be used at your own risk. You should not use the plugin during development stage and should only activate it on a finalised site.



Bob
riga75 09 Jun, 2011
Thanks you're a genius .... two questions:
Where can I find the language file to customize the errors?
You can make the error to appear when the focus leaves the field in question?
GreyHead 09 Jun, 2011
Hi Stefano,

You can set the language of the error messages and set them to appear onBlur as well as onSubmit. Click the Form Name link in the Forms Manager and then the JS Validation tab.

I don't recommend that you edit the files directly (they will be over-written when you upgrade ChronoForms) but you can use the 'title' attribute in the input tags to set a custom message.

Bob
riga75 09 Jun, 2011
Amazing.....😀

Last thing, I have a field type = "checkbox" and when it comes to email if you have selected to get there:
Attachment: YES
but in case you have not selected to get there:
Attached File: {input_file_6}
Can I make additions:
Attachment: NO
GreyHead 09 Jun, 2011
Hi stefano,

Because an un-checked checkbox doesn't return anything when the form is submitted ChronoForms doesn't know that it is supposed to have a value. Use the existing Custom Code action if there is one or, if not, drag a Custom Code action into the OnSubmit event and move it up to before the Email event.

Add this to the code box
<?php
$input_file_6 = JRequest::getString('input_file_6', 'NO', 'post');
$form->data['input_file_6'] = $input_file_6;
?>
This will set the value of input_file_6 to NO if it hasn't been set in the form results.

Bob
riga75 09 Jun, 2011
wonderfull :mrgreen:

I confirm that ChronoForms is the best form ever present in the JED and the forum is absolutely the best around anywhere.
Compliments

stefano
rosalberuccia 25 Jan, 2012
Hi! I have just started to use chronoforms v4 on joomla 1.7 and I have a problem... I can not enable the validation on the form.
I created a form in easy mode. I don't know if my question is clear,isn't it?
Could anyone help me?
Thanks a lot!
GreyHead 25 Jan, 2012
Hi rosalberuccia,

Please see the video below.

Bob

[flash=640,360]http://www.youtube.com/v/IklglmjkEKg[/flash]
There are more videos here that will help you get started with CFv4.
aliranyah 25 Jan, 2012
I have what seems like the same problem, click submit and the form saves blank form even though fields are required, please advise

see attachment for settings, below is a small section of the code showing the fields are required.
check the form at

http://www.asisaudi.com/index.php/mensggsf

auto generated code

<div class="ccms_form_element cfdiv_text" id="autoID-631557039b785f757fbb805a5f8ebc99_container_div"><label>Full Name</label><input maxlength="200" size="30" class=" validate['required','alpha']" title="" type="text" value="" name="input_text_0" />
Max_admin 29 Jan, 2012
Hi,

If the validation doesn't work then the easiest way to find out if there is a conflict between your template, some module or some plugin installed on your website and the core Mootools library (used by Chronoforms for validation) is to add this to the form URL:

&tmpl=component


Then test the form in the new page, if the validation works then there is something wrong at your end.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
goddy 29 Jan, 2012
Hello Admin,
I have same problem. I have added the above code to my form URL, with same result that my form submits without insisting on required fields. are there any other known issues that could be wrong? Would appreciate your assistance in this regard.
Max_admin 29 Jan, 2012
Please send me the form link through the "Contact Us" page.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 31 Jan, 2012
Hi aliranyah,

The query string needs to start with ? not & for the first item e.g. ?param1=value1¶m2=value2¶m3=value3

Bob
aliranyah 03 Feb, 2012
I created another form and it worked, but already wasted countless hours on that form - is there any way to determine whats wrongs with the form?
GreyHead 03 Feb, 2012
Hi aliranyah,

Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.

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