Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / December 2003

Tip: Looking for answers? Try searching our database.

Validate TextBox input as Int32

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pratik Parikh - 17 Dec 2003 15:56 GMT
Hi everyone,

   I was wondering if anone have any idea of how about validateing the
TextBox input is Int32 or not. I want to validate character-by-character.
Please let me know.

here is what i have:
public static function inputQuantityValidater(inputQuantity :
String):String{

var taObj=(event.srcElement)?event.srcElement:'undefined';

if(taObj.value){

}

}
Martin Honnen - 17 Dec 2003 16:51 GMT
>     I was wondering if anone have any idea of how about validateing the
> TextBox input is Int32 or not. I want to validate character-by-character.
[quoted text clipped - 7 lines]
>
> if(taObj.value){

There is an ASP.NET validation control to perform that check:

<%@ Page Language="JScript" %>
<html>
<head>
<title>Using a CompareValidator to check for a certain type</title>
</head>
<body>
<form runat="server">
<p>
<asp:TextBox id="Input0" runat="server" />
<asp:CompareValidator id="CompTypeInt0"
                      ControlToValidate="Input0"
                      Type="Integer"
                      Operator="DataTypeCheck"
                      ErrorMessage="Please enter an integer value."
                      runat="server" />
<input type="submit" id="SubmitButton">
</p>
</form>
</body>
</html>

Signature

    Martin Honnen
    http://JavaScript.FAQTs.com/

Pratik Parikh - 17 Dec 2003 18:31 GMT
Hi Everyone,

I have a problem, the control is auto postback. So it overwrites the screen,
how do I deal with that seniro....Please let me know if you think of
anything, to deal with that. I tried disabling EnableViewState to false. And
it is same with the setting to.

Thank You
> Hi everyone,
>
[quoted text clipped - 13 lines]
>
> }
Martin Honnen - 17 Dec 2003 18:36 GMT
> I have a problem, the control is auto postback. So it overwrites the screen,
> how do I deal with that seniro....Please let me know if you think of
> anything, to deal with that. I tried disabling EnableViewState to false. And
> it is same with the setting to.

Which control?

>>Hi everyone,
>>
[quoted text clipped - 13 lines]
>>
>>}

Signature

    Martin Honnen
    http://JavaScript.FAQTs.com/

Pratik Parikh - 17 Dec 2003 19:06 GMT
TextBox control is autopost.

Thank You

> > I have a problem, the control is auto postback. So it overwrites the screen,
> > how do I deal with that seniro....Please let me know if you think of
[quoted text clipped - 20 lines]
> >>
> >>}
Martin Honnen - 19 Dec 2003 17:17 GMT
> TextBox control is autopost.

If you don't want that you should be able to set
  <asp:TextBox
     AutoPostBack="False"

Signature

    Martin Honnen
    http://JavaScript.FAQTs.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.