• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: how to validate a phone number

how to validate a phone number 16 years 4 months ago #5968

First i'm not a php scripter :blush:

I want to check if the user has put in 10 numbers

found out that i needed to add a function to the validation.php

with google i found some code i thought i could use and with copy past i made this

function phone($param)
{
if(eregi('^[0-9]{10}$', $param )){
return false;
}else{
return true;
}
}

and added it to the validation.php

I could select the function phone in the drop downlist of the form.

But the validation rule i made doesn't validate, anyone any idea what i have done wrong ?

some code that works , but just for one number

function phone($param)
{
if(eregi('[^0-9]', $param )){
return false;
}else{
return true;
}
}<br><br>Post edited by: christina.elisabeth.de.vries, at: 2008/12/21 16:59
The administrator has disabled public write access.

Re:how to validate a phone number 16 years 4 months ago #5971

created this function, and it still doesn't work :S


function phone($param)
{
if(eregi('[0-9]{10}', $param )){
return false;
}else{
return true;
}
}

Created a ( copy from a php book) test script for regular expressions

www.hylkema.bestrijding-apeldoorn.nl/test.php

where you can put the regular expression and the value

And there works the regular expression [0-9]{10} with test string 0123456789 and not in i use it in the validation.php

What mistake do I make ?
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!