Hi,
In the form how it 's possible to limit the password field to 4 digits minimum and 9 maximum.
Thank's a lot
In the form how it 's possible to limit the password field to 4 digits minimum and 9 maximum.
<div class="form_item">
<div class="form_element cf_password">
<label class="cf_label" style="width: 300px;">Mot de passe (4 caractères minimum)* </label>
<input class="cf_inputbox required" maxlength="20" size="4" title="Mot de passe est manquant" id="text_21" name="text_21" type="password" />
</div>
<div class="cfclear"></div>
</div>
Thank's a lot
Hi loloscott78,
You can do it with server-side validation; or with a LiveValidation custom validation. I think that there may be an example like that in the forums here somewhere.
Bob
You can do it with server-side validation; or with a LiveValidation custom validation. I think that there may be an example like that in the forums here somewhere.
Bob
Hi Bob,
I saw the method, but no post about the syntax to limit digit (max and mini).
If you got it.
Thank's.
I saw the method, but no post about the syntax to limit digit (max and mini).
If you got it.
Thank's.
Hi loloscott78 ,
Try this, check the correct input id is used for your form.
Bob
Later: updated to add missing });
Try this, check the correct input id is used for your form.
window.addEvent('domready', function() {
var val_password = new LiveValidation('password');
val_password.add( Validate.Length, {
minimum: 4,
maximum: 9,
wrongLengthMessage: 'Must be between 4 & 9 characters'
});
});
More info hereBob
Later: updated to add missing });
Hi bob,
Where do you insert it? In the validation tab or in the form?
Thank's
Where do you insert it? In the validation tab or in the form?
Thank's
Hi Bob,
I tested it but nothing work.
Password in my form
<div class="form_item">
<div class="form_element cf_password">
<label class="cf_label" style="width: 300px;">Mot de passe (4 caractères minimum)* </label>
<input class="cf_inputbox required" maxlength="20" size="4" title="Mot de passe est manquant" id="text_21" name="mdp" type="password" />
</div>
<div class="cfclear"></div>
</div>
I wrote this in the form Form JavaScript:
window.addEvent('domready', function() {
var text_21 = new LiveValidation('text_21');
text_21.add( Validate.Length, {
minimum: 4,
maximum: 9,
wrongLengthMessage: 'Must be between 4 & 9 characters'
});
Thank's
I tested it but nothing work.
Password in my form
<div class="form_item">
<div class="form_element cf_password">
<label class="cf_label" style="width: 300px;">Mot de passe (4 caractères minimum)* </label>
<input class="cf_inputbox required" maxlength="20" size="4" title="Mot de passe est manquant" id="text_21" name="mdp" type="password" />
</div>
<div class="cfclear"></div>
</div>
I wrote this in the form Form JavaScript:
window.addEvent('domready', function() {
var text_21 = new LiveValidation('text_21');
text_21.add( Validate.Length, {
minimum: 4,
maximum: 9,
wrongLengthMessage: 'Must be between 4 & 9 characters'
});
Thank's
Hi loloscott78;
Sorry, I missed out some closing brackets:
Bob
Sorry, I missed out some closing brackets:
window.addEvent('domready', function() {
var val_password = new LiveValidation('password');
val_password.add( Validate.Length, {
minimum: 4,
maximum: 9,
wrongLengthMessage: 'Must be between 4 & 9 characters'
});
});
You must also have some other validation set or set "Load Chronoforms CSS/JS Files?" to Yes to make sure that the LiveValidation library is loaded.Bob
Hi Bob,
Brackets are ok.
Enable Server Side Validation: yes
Load Chronoforms CSS/JS Files?: yes
But always without validation.Not working!
window.addEvent('domready', function() {
var text_21 = new LiveValidation('text_21');
text_21.add( Validate.Length, {
minimum: 4,
maximum: 9,
wrongLengthMessage: 'Must be between 4 & 9 characters'
});
});
Brackets are ok.
Enable Server Side Validation: yes
Load Chronoforms CSS/JS Files?: yes
But always without validation.Not working!
window.addEvent('domready', function() {
var text_21 = new LiveValidation('text_21');
text_21.add( Validate.Length, {
minimum: 4,
maximum: 9,
wrongLengthMessage: 'Must be between 4 & 9 characters'
});
});
Hi, i used bob's code and it works!
this is my form's code:
and this is my javascript validation code:
are you sure "text_21" is your textbox id?
this is my form's code:
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Nombre(s)*</label>
<input class="cf_inputbox required" maxlength="150" size="30" title="No debe quedar vacío." id="text_2" name="name" type="text" />
</div>
and this is my javascript validation code:
window.addEvent('domready', function() {
var name = new LiveValidation('text_2');
name.add( Validate.Length, {
minimum: 4,
maximum: 9,
wrongLengthMessage: 'Must be between 4 & 9 characters'
});
});
are you sure "text_21" is your textbox id?
Hi loloscott78,
Sounds as though there may be a JavaScript problem. I tested it and it worked form me and for iAleX.
Please post a link to the form so we can take a quick look.
Bob
Sounds as though there may be a JavaScript problem. I tested it and it worked form me and for iAleX.
Please post a link to the form so we can take a quick look.
Bob
This topic is locked and no more replies can be posted.