programmher
Programmer
I am attempting to validate and substitute data for a phone number. If the user attempts to enter an area code other than the valid one, I need to change it. Here is my code:
<script>
function validate_PhoneNum(){
if (document.MyForm.PhoneNum.charAt(3)== "000"
alert("strip 000 and use 123 instead"
return true
}
</script>
<form action="Myform.cfm" name="MyForm" id="MyForm" enablecab="Yes" onsubmit="return validate_PhoneNum(this.PhoneNum.value);"><input type="text" name="PhoneNum" value="">
</form>
I keep getting "object doesn't support this property or method" error message. Why?
Second, what is the best method to change the "000" to "123"?
<script>
function validate_PhoneNum(){
if (document.MyForm.PhoneNum.charAt(3)== "000"
alert("strip 000 and use 123 instead"
return true
}
</script>
<form action="Myform.cfm" name="MyForm" id="MyForm" enablecab="Yes" onsubmit="return validate_PhoneNum(this.PhoneNum.value);"><input type="text" name="PhoneNum" value="">
</form>
I keep getting "object doesn't support this property or method" error message. Why?
Second, what is the best method to change the "000" to "123"?