Forums

chronoform 4 and validation. How ?

giudansky 29 Apr, 2011
In version 4 I cant find the way to make the field validation work.
I set the required fields, activated javascript validation, set the error messages. nothing. on submit the form send everything.
The server side validation says there were errors, but the form is send. Where is for example the beautiful realtime field checking of the previews version ? Please tell me how to make it work somekind of a validation.

thanks to any answer.
GreyHead 29 Apr, 2011
Hi giudansky ,

Please post a link to the form so we can take a quick look.

Bob
giudansky 29 Apr, 2011
you know greyhead, I recognize your avatar, you were a great help in google earth community during katrina hurricane on new orleans... It's a small net ! :-)

So... I cant keep the page online, I attach the html output with the form

[attachment=0]page-with-form.zip[/attachment]
GreyHead 30 Apr, 2011
Hi guidansky,

The problem is almost certainly a conflict with something else on the site, not the form so the form backup doesn't help :-(

And, no that was someone else helping out after Katrina too.

Bob
giudansky 02 May, 2011
you mean everything's good inside the form ?
Btw.. I dont have very clear how to manage validation with V4. Is there an updated guide or a how to that explain the process to activate the validations ?

Is there a javascript validation or also a real time mootool one like in V3 ?
I can't see a straight way to configre one of them...

Strange, I was sure your face was into google earth community...
Thanks
GreyHead 02 May, 2011
Hi guidansky,

It's a different validation library in CFv4 but the activation is similar. Click the configure icon on the element (the spanner to the right of the red x) and then the Validation tab.

Bob
giudansky 03 May, 2011
You didnt help me very much, probably you didnt have time to open my form.

For everyone else in trouble understanding the new V4 javascript validation:
To make it validate I just need to add class=" validate['required']" to every field.

Looks like the key to many features is inside the css class association...

How to enable the "top errors" validation mode ?
GreyHead 03 May, 2011
Hi giudansky,

You can add the class - but that is hard work. Much easier to use the checkboxes as I wrote in my last post.

I also wrote that the form backup isn't helpful as the problem is almost certainly with the site, not the form.

Bob
giudansky 03 May, 2011
I didnt consider the checkbox because i use chronoform with custom made forms. Thats why probably im finding some trouble connecting the various options. But i really wish pure freedom with forms without using the wizard.

Specifically i would love a short explanations about the advanced options/events to drag into onload/onsubmit for activating server validation andcustom errors.
Then, javascript tooltips looks activate even when javascript validation is set to off...
GreyHead 04 May, 2011
Hi giudansky,

I'm sorry I hadn't understood that you were using Custom HTML; in that case you do need to add the validation code by using the classes. There is no equivalent of the 'automatic' validation adder in the CFv3.

Custom Server side validation is fairly straightforward. You just need to make sure that your PHP returns 'true' or 'false'. Ses the Help tab for more information.

I'm not sure what link there is between Tooltips and Validation?

Bob
giudansky 04 May, 2011

Custom Server side validation is fairly straightforward. You just need to make sure that your PHP returns 'true' or 'false'. Ses the Help tab for more information.



No way. The form send without showing any message.
But it's not clear for me the events to drag and drop into onload/onsubmit...

And what about the browser validation ? How to specify and validate a numeric field or an email ?
updated: here it is: class="validate['required','alpha']" alphanum, digit, email...

We really need a manual here :-)
Sorry for so many questions, I'll publish my advances to help the others...
GreyHead 04 May, 2011
Hi Guidansky,

We really need a manual here

I couldn't agree more - I'll write it when there are fewer posts to answer here.

For Custom Server Side Validation. Here's a code example:
<?php
$test = JRequest::getString('input_text_0', '', 'post');
if ( !$test ) {
  $form->validation_errors['input_text_0'] = "This can't be empty.";
  return false;
}
?>
and you need an Event Loop action in the OnFail event to re-display the form (the default configuration is OK).

For the other browser validations see the FormCheck docs here e.g. validate['number']

Bob
dryke_chris 05 Sep, 2013
The only validation that is working for me is the captcha validation. On the "Code" tab, I've tried setting "Form Type" to both Wizard Designer and Custom Code, adding the CSS
class="validate['required']"
code to an input tag and that didn't work. Not sure what the exact code to put in the "Not Empty" textbox under the "Validation" tab should be; I've tried separating names on different lines or with commas and some other things. I can't get anything to work for me. Any help would be greatly appreciated.

Using Chronoforms 4.0 RC2 on Joomla 3.1.5.
GreyHead 06 Sep, 2013
Hi dryke_cris,

I assume that you are talking about Client side validation that shows little bubble messages when there is an error?

Please create a new form using the Form Wizard with just a single Text Box element and a Submit Button in the Preview box and a Show HTML action in the On Load action. Open the Text Box element and click required on the Validation tab. Give the form a name and Save it. Click the Test Form icon in the toolbar and try to Submit the form.

If you see a bubble error on the text input then validation is working OK here without the template.

If there's no bubble (unlikely but possible) check the JavaScript tab in your browser Web Developer tools for any error messages.

If the validation is working without the template then go back to the Forms Manager and click the Front End View link and repeat the tests.

If you find an error with these tests then there is a JavaScript conflict that needs to be resolved. If these tests are OK then something is wrong in the setup of your other form.

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