Not possible to combine validators| CheckBox group validatio

01 30 Aug, 2013
Hi!
I'm using the latest chronoforms for Joomla 3.x.
I've got a situation when I need to combine mu custom validation with provided native.
My custom solves the multilang problem. The native validation doesn't support Cyrillic and Baltic characters, only Latin are supported. Was is really not good.
So when I combine native validators(for example Alphanum) and custom - validator's chain brakes.
My custom validator doesn't accept digits and alphanum - doesn't support Cyrillic symbols: both of them fails and we got absolute validators brake chain🙂

And a bit another question from CheckBox group:
when validation fails - all prechecked values get nulled. Is it a bug or there is a special option to fix it?
GreyHead 30 Aug, 2013
Hi 01,

I'm sorry but I don't understand your question - is there a question?

How are you adding your custom validation?

As far as I know checkbox groups are not nullified on an error.

Bob
01 30 Aug, 2013
Hi, Bob!
It's a bug's description.
I tried in that way:
validate['required','%customCheck','alphaNum']

The formcheck-yui.js doesn't support this kind of combination: AlphaNum+Custom Validation
If one of these two validators will give '0' result the main result will be - "failure".

Regarding CheckBox Group:
I've got group with this kind options:
отношения родители и дети=„отношения родители и дети“
коммуникативные ситуации на работе=„коммуникативные ситуации на работе“

It's a text values. Validation- 1 Required "checked"
And in event I've a arrayHandle with "," delimiter.
The checked options are sent through the mail, but when validation fails - they are not prechecked😟
GreyHead 30 Aug, 2013
Hi 01,

The formcheck-yui.js doesn't support this kind of combination: AlphaNum+Custom Validation
If one of these two validators will give '0' result the main result will be - "failure".

That sounds to me as if it is working correctly? If either validation fails then the result is a failure?

I built a form to check the checkbox group reload here - leave the second text box empty to test. The checkboxes are re-loaded OK.

Bob
01 30 Aug, 2013

That sounds to me as if it is working correctly? If either validation fails then the result is a failure?


No😟 it isn't.
My CustomValidation provides support for Cyrillic & Baltic symbols:
function customCheck(el){
    if (!el.value.test(/^[а-яА-ЯёЁa-zA-Z ąčęėįšųūžĄČĘĖĮŠŲŪŽ]+$/)) {

        el.errors.push("Используйте только кириллические символы или латинские");
        return false;
    } else {
        return true;
    }
}

Alphanum in conjunction with CustomValidation can't make a successful check, because Alphanum doesn't support Cyrillic symbols and CustomValidation doesn't support digits. So it gets into deadlock.
So, I made mistake, claiming that validators don't work in combination, they just don't work in such case. My opinion is that some kind of non Latin symbols native support should be done...


Regarding CheckBox group, could you attach your form's backup file? Cause I can't find the error in my form and yours is working properly.
Thank you!
GreyHead 30 Aug, 2013
Hi 01,

I've attached the form - it is very simple. I just copied your options into the checkbox group.

If you have an Alphanum validation it will only accept A-Z 0-9, if you have a Custom Cyrillic validation it will only accept A-Я (I guess). So either one can be true but not both.

If you want to accept both then you need a Custom Validation that will accept A-Z A-Я 0-9

Please see this FAQ which may help.

Bob
01 30 Aug, 2013
Hi, Bob!
Thank you for you info!
I will test your form and will try to change the custom validation.
If I won't encounter any problems, I won't bother you today🙂
Thank you!
This topic is locked and no more replies can be posted.