validation not numbers is not running

jaem15 20 Jan, 2011
Hola a todos.
I have the chronoforms version V3.1_RC5.2 and i have a problem with the "not number" validation. All the rest of validations (required, validate-email, alpha, etc) run ok and shows my text i put in "title", except the fields with "digits-only".

¿is there a bug with this or i have some mistake?

Thank you very much and sorry about my english

Luis Llano
GreyHead 20 Jan, 2011
Hi Luis,

How are you setting up the validation? If you are adding classes then the class for digits only is validate-digits.

Please post a link to the form so we can take a quick look.

Bob
jaem15 20 Jan, 2011
I am testing this form in local before upload to web. I have other forms in my web, but any of their fields with this type of validation.
The code of the field is this:
<input name="dni" id="dni" value="" class="cf_inputbox required validate-digits" title="Este campo es obligatorio y sólo se permiten dígitos" size="8" maxlength="8" type="text">
.

thank you
GreyHead 20 Jan, 2011
Hi jaem15,

Looks Ok here. Though for some reason the message reverts to English if you enter text in the box.

Bob
jaem15 20 Jan, 2011
Exactly ... it doesnt show the text of the "title" as in all the other cases.
It shows the default text "must be a number!" included in the file "livevalidation_standalone.js".
GreyHead 21 Jan, 2011
Hi jaem15,

You can hack the core file to correct this. Open components/com_chronocontact/js/jsvalidation2.js and find this code around line 109 and add the marked line
			if(field.hasClass('validate-digits')){
				if( tmessage) { var message_validate_digits = tmessage; }
				name.add( Validate.Numericality, { 
					notANumberMessage: message_validate_digits, // <-- add this line 
					notAnIntegerMessage: message_validate_digits
				});
				fieldsarray[fieldsarray_count] = name;
				fieldsarray_count = fieldsarray_count + 1;
			}

Bob
jaem15 21 Jan, 2011
Perfect!!! Now its running the title message. I continue testing my forms.

Thank you very, very much.
This topic is locked and no more replies can be posted.