Resource Responses

Search Guest Response by Email:
Total 1 responses found.
Validating Mobile number using javascript
I have a TextBox for mobile num with ID "txtMobileNo".
And the below JS function is assigned to Button as below:-



function ToCellValidate()
{

var mob = document.getElementById(<%=txtMobileNo.ClientID%>").value;

if(mob !="")
{
var incomingString = mob ;
if(trimSpace(incomingString).length > 15 || incomingString.search(/[^0-9\-()+]/g) != -1 )
{
alert('Please enter valid mobile number');
txtMobileNo.focus();
txtMobileNo.value="";
return false;
}
else
return true;
}
}

Please tell me what is wrong with above JS function.
Author: Pramod      Posted Date: 11 Aug 2010



Top Contributors
TodayLast 7 Daysmore...

Awards & Gifts

Online Members

ramana
More...
 
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India