Forums

Customize Validation Message

LikeStuff 19 Apr, 2011
Joomla 1.6.1
Chrono Forms 4.0 RC1.8

In the older version we would add the fields we want validated separated by a comma and we would get the message that a field is required next to the field, so the user would know which field should not be blank.

With this new version the message is at the top of the form, which I don't mind, but it does not indicate which fields are required. The information is displayed like this:

This field should NOT be empty.
This field should contain an email address.
This field should NOT be empty.
This field should NOT be empty.

How do I personalize the message so that the field name is added in the message. For example, The name field should NOT be empty, etc...

Thank you!!
GreyHead 19 Apr, 2011
Hi LikeStuff ,

It sounds as though you are using serverside validation. If you use the browser validation then the messages are little baloons over the inputs.

Bob
LikeStuff 19 Apr, 2011
I was really trying not to ask but where do I add the browser validation? Do I replace the "Auto Server Side Validation" with the "Custom Server Side Validation" and put my own code? I don't see "Custom Server Side Validation" as one of the actions.

Thanks!!
GreyHead 19 Apr, 2011
Hi LikeStuff,

The equivalent of the old validation tab is now the individual Validation tabs on each element. Click the spanner icon to open the element config and then the Validation tab to see a set of checkboxes.

If you want to really go custom then you can use a Load JS* Action.

Bob

* I also posted a Load JS File action in the forums here.
LikeStuff 21 Apr, 2011
So so sorry GreyHead, but I'm not seeing what you are explaining. There are 3 icons at the right of each element, the X, a blue tingy and a green icon.

What element do I need to drag over? Would you mind giving me a screen shot - sorry but I'm lost on this too... Plus I searched but did not find the post regarding the Load JS File action in the forum.

Thanks and sorry to bother you so much๐Ÿ˜Ÿ
GreyHead 22 Apr, 2011
Hi LikeStuff,

It's the middle icon you need; I think it's a spanner.
[attachment=0]22-04-2011 09-16-48.png[/attachment]

The Upload JS file (and upload CSS file) actions are here

Bob
LikeStuff 24 Jun, 2011
I'm still working on this๐Ÿ˜Ÿ

Below are the files that were extracted as per the link you provided. I just want to confirm that I should upload those files here: administrator/components/com_chronoforms/form_actions

cfaction_load_css_file.ctp
cfaction_load_css_file.php
cfaction_load_js_file.ctp
cfaction_load_js_file.php
index.html
load_css_file.ctp
load_css_file.php
load_js_file.ctp
load_js_file.php

Thanks!!
GreyHead 25 Jun, 2011
Hi LikeStuff,

The files *should* be in two separate folders

These files in a load_css_file folder:

index.html
load_css_file.ctp
load_css_file.php
cfaction_load_css_file.ctp
cfaction_load_css_file.php



These files in a load_js_file folder:

index.html
load_js_file.ctp
load_js_file.php
cfaction_load_js_file.ctp
cfaction_load_js_file.php



Then each of those folders goes into the administrator/components/com_chronoforms/form_actions folder.

Bob
LikeStuff 30 Jun, 2011
Ok so now that I have those files uploaded I guess I have to add the validation code in the "Load Js"? If so, would me mind giving me an example of what the code for one of the fields should look like - then I can follow the example to do the rest. Sorry for all the questions, but it's a bit over my head.๐Ÿ˜Ÿ

Thank you!!
GreyHead 01 Jul, 2011
Hi LikeStuff,

The equivalent of the old validation tab is now the individual Validation tabs on each element. Click the spanner icon to open the element config and then the Validation tab to see a set of checkboxes.


Bob

PS I suspect you didn't need the Load JS File action at all :-(
LikeStuff 05 Jul, 2011
Either we are using different versions or I'm just out to lunch but I'm just not getting this to work. When I click on the spanner there are no checkboxes. Am I supposed to add something in addition to what I have to the Auto Server Side Validation in order to see some check boxes. Please see pic. You were kind enough to edit the form for me and I did not change anything since - I think?

Thanks!!
GreyHead 05 Jul, 2011
Hi LikeStuff,

Those are the form 'actions'. Click the Preview tab and use the spanner icon on the 'elements' i.e. the form inputs, select boxes, etc. to set the validations.

Bob
LikeStuff 12 Jul, 2011
OK I see what you mean but it says "Your form type is "Custom" and so you can NOT add/edit the form fields (code) in the wizard, any fields you add here now will NOT be saved."

Does this mean it's better to change the form to a Custom Form? Oh Boy... This used to be so easy :?

Thanks!!
GreyHead 14 Jul, 2011
Hi LikeStuff,

If you are using custom Form hTML then you have to add the validation classes by hand :-(

For example
class="cf_some_class validate['required','length[4, -1]','differs[email]','digit']"
Info about the classes is here

Bob

PS Don't leave any spaces between multiple validations.
LikeStuff 15 Jul, 2011
I decided to use the "Wizard" instead of "Custom" to build my form which seems to be working better for me. Hopefully I will stop buggin' you soon...๐Ÿ˜€

1. Some of the fields as per the attached form are required fields. I'm not sure how to add a star "*" next to the required fields. PS: I like the little popup bubble.

2. Also, how can I get the words "Enter verification code" to move above the box instead of on the left as it is now.

Thanks in advance!!
LikeStuff 15 Jul, 2011
I fixed item #2 by using a header element.

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