Jump to content

Archived

This topic is now archived and is closed to further replies.

hardhead04

Phone Number Retrieval

Recommended Posts

Can anyone tell me how i can get my database to retrieve full phone numbers without asking my users to type their phone numbers without spaces. The only information that gets to my database is the numbers before the a space or dash.

 

Example:

312-432-5932 or 312 432 5932

 

My database only recieves the \"312\" which are the numbers before the space. I will be very greatfull if someone can help me wit this. Thanx

Share this post


Link to post
Share on other sites

Hey,

 

I\'m new at this also, but I would have \"thought\" that on the form you could seperate the area code, phone number etc.. limit the field sizes to the number of digitis required.. and place some javascript to ensure they entered in the required number of digits. That way you could append the data together, and send it off as a single digit?

 

Cheers

Share this post


Link to post
Share on other sites

Alright thanx i did that. but how do i go about appending the data in those three seperate forms to the same record in the database?

Share this post


Link to post
Share on other sites

..maybe something along the lines of....


<form>

<input type="text" size="3" name="areacode" maxlength="3">

-

<input type="text" size="3" name="number1" maxlength="3">

-

<input type="text" size="4" name="number2" maxlength="4">

<br>

<input type="submit" value="submit">

</form>

Share this post


Link to post
Share on other sites

thanx but i already did that but the database is only recieving the last 4 digits of the phone number. which is \"number2\" in your example. the information in \"areacode\" and \"number1\" is lost. Should I change the record values in the database or should i make seperate records for \"area code\", \"number1\", and \"number2\" in the database.

Share this post


Link to post
Share on other sites

just go like this...

 

[php:1:c2d757dd8a]<?php

$complete_phone = $area_code . $number1 . $number2;

?>[/php:1:c2d757dd8a]

 

BS :D

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.