Forums

LiveValidation

each 25 May, 2011
Hi

I wanted to know if liveValidation was in use in CFV4 as i don't find the filein the directory and as I tried to validate my password field by the following rule in LoadJS events :

window.addEvent('domready', function() {
var name = new LiveValidation('password');
name.add( Validate.Length, {
minimum: 4,
maximum: 9,
wrongLengthMessage: 'Must be between 4 & 9 characters'
});
});

But it doesn't work

Any idea of the problem

Thanks a lot

Eric
GreyHead 25 May, 2011
Hi Eric,

No; Max has switched to the MooTools based FormCheck in CFv4.

I think you should be able to validate length with
validate['length[4, 9]']


Bob
each 25 May, 2011
Thanks for your support Bob

If i put validate['length[4, 9]'] in my password class field , there is nothing more

Is it a wrong way ?

Eric
GreyHead 25 May, 2011
Hi Eric,

I don't know - please look at the FormCheck documents.

Bob
each 26 May, 2011
i did and solved the problem with the following code

function customCheck(el){
    if (!el.value.test(/^[A-Za-z0-9]{9}/)) {
        el.errors.push("le mot de passe doit être composé de 9 caractères alphanumériques");
        return false;
    } else {
        return true;
    }
}


Just a question ...
Is it possible to put these codes in only one js event ?

Thanks

Eric
GreyHead 27 May, 2011
Hi Eric,

I'm not sure what you are asking? Can you put them in one Load JS event? Yes you can add as much as you like in the code box.

Bob
webcorp 29 Jun, 2011
Hi

I'm trying make this works too ( with no sucess )

My code :
<input id="field" maxlength="100" size="10" class=" validate['required', 'alpha', 'length[4, 9]']" title="" type="text" value="" name="field" />


My config :
Auto Detect Settings - Yes
Load Chronoforms files - ALL
Add form tags - Yes
Enable Joomla plugins - No

How I can use 'length[4, 9]' inside class without voiding the validation ?

Thanks for help
GreyHead 29 Jun, 2011
Hi webcorp,

You have to add the class with no spaces at all. Put this into the Class box of the input:
validate['required','alpha','length[4,9]']

Bob
webcorp 30 Jun, 2011
Thanks a lot Bob !!!

Do you want a beer ??
:)
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger