Forums

How to validate numbers

Conyard 21 Oct, 2011
Hello chronoforms community!

I am quite new to chronoforms and I was wondering how numbers are validating using chronoforms. I have posted only one previous topic since I joined this community.

In this post I was asking how chronoforms include required fields so that a form cannot be submitted unless information has been entered into a required field.

Thanks to greyhead I realised I was missing a space in the code, but the right syntax for validating a required field is:

class=" ['required']"


When the same task is carried out for number validation in chronoforms the right syntax for a field to be number validated is:

class=" ['number']"


Unfortunately when I have tried this the text field still allows me to enter and submit letters.

Is there something I am missing in correctly performing number validation on a text field?

If anyone can help in this matter it will be greatly appreciated!
GreyHead 21 Oct, 2011
Hi Conyard,

Please check the FormCheck documents here I think the format you want is like this
<input class="validate['required','number']" />
or this
<input class="validate['number']" />

Bob
Conyard 07 Nov, 2011
Thanks greyhead,

That is useful information, however I realised I did something dappy and did not enable javascript within chronoforms in the Joomla backend.

Thanks again for getting back to me.
This topic is locked and no more replies can be posted.