Have had a look around and tried playing with code but it's time to ask. How do i check that only numbers are used in a required field? I altered marital status to become a field for phone numbers so i have the following and just want to add the numeric check and not allow spaces. And yes in thr profile and register it does actually say "Phone Number"
if Len(Trim(Request.Form("MarStatus"))) = 0 then Err_Msg = Err_Msg & "<li>You must enter your Phone Number.</li>" end if if Len(Request.Form("MarStatus")) < 8 then Err_Msg = Err_Msg & "<li>Your Phone Number must be at least 8 characters.</li>" end if
Anyone who says a square peg does not fit into a circular hole has never seen a crazy bítch with a hammer
to check for spaces you can use the InStr function, and to check for only numeric values you can try converting the string to a number using the CLng function
There is an IsNumeric() function in VBScript. Just keep in mind that you are going to want to account for those that enter their phone number with dashes and/or parenthesis. It may be a little over-kill, but a quality regular expression would go a long way to making life easier in checking for this...