Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to restrict......

Reply
Thread Tools

how to restrict......

 
 
atif
Guest
Posts: n/a
 
      01-13-2004
I hav a prob with the textfield i want to restrict this field so that
only integer values should b entered e.g 0-9 n no english or special
characters should b entered in the text field


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
 
Reply With Quote
 
 
 
 
Hermit Dave
Guest
Posts: n/a
 
      01-13-2004
use a regular expression validation control ?

with expression like
\d{5,20}


or you could also use range validator...

specify it as integer or double and specify the range and control you wish
to check...

--
Regards,

HD

"atif" <(E-Mail Removed)-spam.invalid> wrote in message
news:40039b8f$(E-Mail Removed)...
> I hav a prob with the textfield i want to restrict this field so that
> only integer values should b entered e.g 0-9 n no english or special
> characters should b entered in the text field
>
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com



 
Reply With Quote
 
 
 
 
Dan Brussee
Guest
Posts: n/a
 
      01-13-2004
What I think you are asking for is a masked edit text box where it
will only allow the digit characters to be entered. This action would
be required on the client side - not on the server side, so ASP.NET is
not involved. As stated in another response, you could do validation
using regular expression, javascript, etc on the client or after it
has been submitted on the server.

However, there are cases where what you ask CAN be done on the client.
It would require some fairly complex Javascript code and would very
prone to failures on certain versions of browser. Although it seems
reasonable to do, I say that it is easier all around - including for
the user - if you just let them type what they want and validate it
for correctness. Im sure you will need to validat anyway to be sure a
value exists, etc. Remember, you are dealing with a very limited
environment of a browser. I always hated masked input fields anyway,
but that's just me

Dan


On 13 Jan 2004 01:17:35 -0600,
http://www.velocityreviews.com/forums/(E-Mail Removed)-spam.invalid (atif) wrote:

>I hav a prob with the textfield i want to restrict this field so that
>only integer values should b entered e.g 0-9 n no english or special
>characters should b entered in the text field
>
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
>----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
>----------------------------------------------------------
> http://www.usenet.com


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments