Hi,
I want to use custom client side validation and followed the instructions described here: http://www.chronoengine.com/faqs/2656-how-can-i-add-a-custom-client-side-validation.html
Unfortunately it only works on one field and I want to use it for (almost) all the fields in the form.
I added the script in a load-js-event and changed the "customCheck" (in the function as well as the class name of the field). I tried to put more than one functions in one load-js-event and I tried to use a load-js-event foar each field; both didn't work.
(The standard javascript validation works good on the site.)
I want to use custom client side validation and followed the instructions described here: http://www.chronoengine.com/faqs/2656-how-can-i-add-a-custom-client-side-validation.html
Unfortunately it only works on one field and I want to use it for (almost) all the fields in the form.
I added the script in a load-js-event and changed the "customCheck" (in the function as well as the class name of the field). I tried to put more than one functions in one load-js-event and I tried to use a load-js-event foar each field; both didn't work.
(The standard javascript validation works good on the site.)
Hi Liesbeth,
YOu can create more than one validation - but each one much have a different function name. customCheck1(), customCheck2() . . . or whatever names you choose as long as they are different from the existing validations.
You can apply any custom validation to more than one form element by adding the class as described in the FAQ.
You can put all of the custom validation code in the same Load JS action.
Bob
YOu can create more than one validation - but each one much have a different function name. customCheck1(), customCheck2() . . . or whatever names you choose as long as they are different from the existing validations.
You can apply any custom validation to more than one form element by adding the class as described in the FAQ.
You can put all of the custom validation code in the same Load JS action.
Bob
Thank you,
In one way or another I didn't put the regex in the right way and that did the trick๐ .
But now I have my own error message shown up as well as the regular validation text and it looks like this:
This field is required.
Please enter your name.
This field is required.
I just want my own text (Please enter your name.), like I added in the load js. Disabling jsvalidation in the form settings doesn't seem to matter.
In one way or another I didn't put the regex in the right way and that did the trick๐ .
But now I have my own error message shown up as well as the regular validation text and it looks like this:
This field is required.
Please enter your name.
This field is required.
I just want my own text (Please enter your name.), like I added in the load js. Disabling jsvalidation in the form settings doesn't seem to matter.
Hi Liesbeth,
Do you still have the Required box checked on the element Validation tab?
Bob
Do you still have the Required box checked on the element Validation tab?
Bob
Hi Bob,
Thank you; I unchecked the required box, but then it says:
This field is required.
Please enter your name.
Liesbeth
Thank you; I unchecked the required box, but then it says:
This field is required.
Please enter your name.
Liesbeth
Hi Liesbeth,
Then there is probably still another validation on that form element. I can't tell where it is set though :-(
Bob
Then there is probably still another validation on that form element. I can't tell where it is set though :-(
Bob
Hi Bob,
I turned off the validations of all the fields and still the same problem:
You can see the form here: http://www.eductum.nl/index.php?option=com_chronoforms&chronoform=bestelformulier
I turned off the validations of all the fields and still the same problem:
You can see the form here: http://www.eductum.nl/index.php?option=com_chronoforms&chronoform=bestelformulier
Hi Liebeth,
If I look at the Form HTML the Antal input has class="validate['required','%aantal'] validate['number']" with an error message for each of the validations which is correct.
The question is where are the two extra validations being set?
Bob
If I look at the Form HTML the Antal input has class="validate['required','%aantal'] validate['number']" with an error message for each of the validations which is correct.
The question is where are the two extra validations being set?
Bob
Hi Bob,
What do you mean with the "two extra validations"; I don't understand where you are referring to.
Does every has to have a validation?
Liesbeth
What do you mean with the "two extra validations"; I don't understand where you are referring to.
Does every has to have a validation?
Liesbeth
Hi Liesbeth,
You have three validations set: 'required', '%aantal' and 'number'. Each of these will add an error message if the validation fails.
Bob
You have three validations set: 'required', '%aantal' and 'number'. Each of these will add an error message if the validation fails.
Bob
Okay, thank you, I understand it.
But when I delete 'required' and 'number', the validation doesn't work at all.๐
But when I delete 'required' and 'number', the validation doesn't work at all.๐
Yes, I temporarely "solved" it by deleting the text "this field is required" from the language file.
Hi Liesbeth,
You still have a 'required' validation set on the inputs - that's why the 'required' error shows, or would show id you hadn't removed the message.
Bob
You still have a 'required' validation set on the inputs - that's why the 'required' error shows, or would show id you hadn't removed the message.
Bob
Hi Bob,
Yes, I know, but, as I said in an earlyer post: the validation does'nt work at all when I remove 'requiered' from the field class.
So this works: validate['required','%aantal']
And this doesn't work: validate['%aantal']
Yes, I know, but, as I said in an earlyer post: the validation does'nt work at all when I remove 'requiered' from the field class.
So this works: validate['required','%aantal']
And this doesn't work: validate['%aantal']
This topic is locked and no more replies can be posted.
