Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > isNaN function jscript

Reply
Thread Tools

isNaN function jscript

 
 
=?Utf-8?B?c2lhag==?=
Guest
Posts: n/a
 
      03-08-2005
I am new to jscript..
I am trying to validate if a textbox on my ASP.NET page has numeric value..
The code I am using is

function IsValidAmount()
{
var intTotalAmt = document.Form1.txtTotalAmt.value;
If (isNaN(intAmt1)== false)
{//do something}
}

I am getting a Object Expected error at the If Condition. can someone guide
me on the same...
Also Is it is OK using the isNaN function for Numeic validation as I have
seen people writing there own custom IsNumeric Function for the purpose.

cheers,
siaj
 
Reply With Quote
 
 
 
 
Riki
Guest
Posts: n/a
 
      03-08-2005

"siaj" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am new to jscript..
> I am trying to validate if a textbox on my ASP.NET page has numeric

value..
> The code I am using is
>
> function IsValidAmount()
> {
> var intTotalAmt = document.Form1.txtTotalAmt.value;
> If (isNaN(intAmt1)== false)
> {//do something}
> }
>
> I am getting a Object Expected error at the If Condition. can someone

guide
> me on the same...
> Also Is it is OK using the isNaN function for Numeic validation as I have
> seen people writing there own custom IsNumeric Function for the purpose.
>
> cheers,
> siaj


if should be written in lower case.

Riki


 
Reply With Quote
 
 
 
 
=?Utf-8?B?c2lhag==?=
Guest
Posts: n/a
 
      03-08-2005
Tanks Riki..
I m just kicking mself...

BTW am I right using isNaN for IsNumeric requirement..

cheers,
siaj

"siaj" wrote:

> I am new to jscript..
> I am trying to validate if a textbox on my ASP.NET page has numeric value..
> The code I am using is
>
> function IsValidAmount()
> {
> var intTotalAmt = document.Form1.txtTotalAmt.value;
> If (isNaN(intAmt1)== false)
> {//do something}
> }
>
> I am getting a Object Expected error at the If Condition. can someone guide
> me on the same...
> Also Is it is OK using the isNaN function for Numeic validation as I have
> seen people writing there own custom IsNumeric Function for the purpose.
>
> cheers,
> siaj

 
Reply With Quote
 
recoil@community.nospam
Guest
Posts: n/a
 
      03-08-2005
was the problem solved?
If not you should probably check your document.Form1.controlname and
make sure that everything is kosher there.
you should also probably try document.forms[0].controlname as I believe
this is more cross-browser friendly.

 
Reply With Quote
 
=?Utf-8?B?c2lhag==?=
Guest
Posts: n/a
 
      03-08-2005

Yeah the problem got solved....
siaj



"(E-Mail Removed)" wrote:

> was the problem solved?
> If not you should probably check your document.Form1.controlname and
> make sure that everything is kosher there.
> you should also probably try document.forms[0].controlname as I believe
> this is more cross-browser friendly.
>
>

 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Server-Side Jscript (not Jscript.NET)? Maxwell2006 ASP .Net 5 03-07-2006 05:28 AM
JScript.Net (JScript 7.0) is official documented language VK Javascript 4 01-12-2006 06:48 PM
Porting from JScript to JScript.Net - compiler error Jon Maz ASP .Net 4 09-09-2004 10:24 AM
Re: help on rewritting c++ for Mac into MSDOS - "IsNan.c" 5832 Bytes Christopher Benson-Manica C++ 0 05-11-2004 01:19 PM
Which to Learn: Javascript, Jscript, JScript.NET, ECMA 262 (3rd ed)? John Bentley Javascript 14 02-05-2004 06:14 PM



Advertisments