validation java question

carlosT 10 Sep, 2008
I am trying to validate a 10 digit phone number, and I have absolutely no idea how to write the code in the validation .js files, its like the hebrew of coding languages to me.

I managed to tweak validation.js by changing the currency checker to my own...

['validate-currency-dollar', 'Enter a valid 10 digit mobile number, starting with 0, no spaces or characters.', function(v) {
								minLength : 10,
								maxlength : 10
							}]

But if i do EXACTLY the same change in mooValidation.js (which I need to use cos of template conflicts) validation stops working.

Any ideas why that doesn't work would be great but even better if someone could help me validate the number properly, I will buy this component for sure!!

This is how I normally validate a South African mobile number in php...

$mobile = substr($mobile, 1, 15); // removes the 0 at start

		if ( ! ((  $mobile > '700000000' ) && (  $mobile < '899999999' ) ) )  {


if someone could intergrate that into the mooValidation.js they would be my hero.
Max_admin 10 Sep, 2008
Hi carlos,

I think somebody made this before here, search the forums for phone number validation and let me know

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.