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 ||[^0-9\-()+]/g) != -1 )
alert('Please enter valid mobile number');
return false;
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

Anjali Bansal
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India