Announcement

Collapse
No announcement yet.

Telephone Number Check

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Telephone Number Check

    I am trying to stop people from entering a mobile phone number onto our website is there some sort of script i can put in the site so when ever the first two numbers equals 07 it tells them this is not a valid phone number or non acceptable number. ?
    James
    ------------------
    ModelPower.co.uk - Quality Batteries - Affordable Prices

    #2
    Edit Act_Order01.html (in Site1). Look for

    Code:
          <INPUT TYPE="TEXT" NAME="INVOICEPHONE" SIZE="20" MAXLENGTH="25" VALUE="NETQUOTEVAR:INVOICEPHONE">
    
    Change it to
    
          <INPUT TYPE="TEXT" NAME="INVOICEPHONE" SIZE="20" MAXLENGTH="25" VALUE="NETQUOTEVAR:INVOICEPHONE"
            onchange="javascript:if ( this.value.search(/^07/) > -1 ) alert('Please enter a landline number');">
    Note that the word "java script" above should be "javascript" without the space - the Forum is munging such things again.

    This will bung up an alert if they enter 07 numbers. It won't stop the form being submitted however but at least they will have been warned.

    You can enter more text into the Please enter... bit but don't use the ' or " characters.

    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment

    Working...
    X