Solved

how to validate number insert to a textbox field?

Posted on 2004-08-31
3
247 Views
Last Modified: 2010-04-15
I have a textbox in a form where I need to enter the number of users. I need to make sure the person enters a number on that field. How can I validate that field?
code----
<tr>
<td class="NavyBold">Number of Users
<br>
(if multiple users):</td>
<td><asp:textbox id="txtusernumber" Runat="server" Width="50Px" MaxLength="4"></asp:textbox></td>
</tr>
0
Comment
Question by:devweez
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
msdixon earned 125 total points
ID: 11945781
add this to your page. it should point you in the right direction:

<asp:comparevalidator id="CompareValidator1" style="Z-INDEX: 104; LEFT: 136px; POSITION: absolute; TOP: 32px"
            runat="server" errormessage="Oops" type="Integer" controltovalidate="txtusernumber" valuetocompare="0"
            operator="GreaterThan"></asp:comparevalidator>
0
 

Author Comment

by:devweez
ID: 11948312
Worked like a charm! thank you for the quick turn around on your answer. really helped!
0
 
LVL 9

Expert Comment

by:msdixon
ID: 11948422
no problem
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question