Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Validate phone number/std code before adding to database

Question posted by: jhansi (Newbie) on March 26th, 2008 11:44 AM
hi...


I have created a form it's working properly.... but i want to consider phone number and STD code in two different text field for a single lable phone number.....

and I have considered the fields like first name,last name,Date of birth, Phone Number ,mobile number and address...

1)If i enter all the fields then only the values should enter into the database...
2) if i dint enter the mobile field then also it should save into the database.
3) If i dint enter the phone number field then the values should not enter into the database..

please reply me as soon as possible

thanks in advance
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
acoder's Avatar
acoder
Site Moderator
11,000 Posts
June 29th, 2008
10:49 AM
#2

Re: Validate phone number/std code before adding to database
The idea is simple. Validate your data before adding to the database. All you need to check in this case besides security/sanitation checks is that the phone number has been entered. If it hasn't, then display an error message.

Reply
Reply
Not the answer you were looking for? Post your question . . .
184,216 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Ruby / Rails Forum Contributors