
May 12th, 2008, 07:28 PM
|
 |
KIS
|
|
Join Date: Jul 2007
Location: USA
|
|
Quote: | Originally Posted by craign924 hello,
i see on many web pages -- that phone numbers are split into
3 text boxes area code, local code , and the number. i would like to do this on my site. i would like to rejoin them into one field in my access database. i have been searching online for a tutorial but i am not sure what this is called.
can someone point me to a tutorial that points out how this is done.
thanks ,
Craig |
it is called string concatenation
Code:
<form action="phone.asp" method="post">
( <input name="areacode" size="3" maxlength="3"> )
<input name="prefix" size="3" maxlength="3"> -
<input name="linenum" size="3" maxlength="4">
<input type="submit" name="submit" value="Submit">
</form>
<%
iAreaCode = Request.Form("areacode")
iPrefix = Request.Form("prefix")
iLineNum = Request.Form("linenum")
If Request.Form("submit") <> "" Then
' simple validation
If isNumeric(iAreaCode) AND _
isNumeric(iPrefix) AND _
isNumeric(iLineNum) Then
' concatenating the variable values into one variable
iPhoneDigits = iAreacode & iPrefix & iLineNum
' sql insert code
Else
Response.Write "Error: Invalid number"
End If
End If
%>
__________________
Please give respect to those that helped solve an issue by clicking on the reputation icon
|