TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ashok N
NA
8
8.8k
Validating mobileNo.
Aug 11 2010 1:52 AM
In asp.net appln, I have a TextBox for mobile num with ID "txtMobileNo".
And the below JS function is assigned to Button as below:-
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="ToCellValidate()"/>
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.
Reply
Answers (
1
)
How to set the position of scrollbar at the bottom of div using CSS2.0?
browser window can't close in firefox through close() in javascript