Solved

how to validate number insert to a textbox field?

Posted on 2004-08-31
3
248 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.NET Enums [Flags] & Bitwise Design Question 6 53
Fastest way to get file count in MS Server 2012 3 36
WPF and Powershell button hover change text 5 63
Load XML element 3 43
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!

739 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