negative values

1. Member
Join Date
Dec 1969
Posts
93

## negative values

Hi all!<BR><BR>I am calling this function<BR><BR>function showTotalOne (strH1, strH2, strH3)<BR> {<BR> if (isNaN(document.forms[2][strH1].value))<BR> document.forms[2][strH1].value = "0" ;<BR> if (isNaN(document.forms[2][strH2].value))<BR> document.forms[2][strH2].value = "0" ;<BR> <BR> document.forms[2][strH3].value = document.forms[2][strH2].value ;<BR> <BR> }<BR><BR>for the textboxes if the user inputs -ve values it should change it to 0..<BR><BR>Pls help<BR><BR>

2. Senior Member
Join Date
Dec 1969
Posts
16,931

## RE: negative values

Ok, so how do you test if something is negative?<BR><BR>What&#039;s the DEFINITION of a negative value?<BR><BR>Craig.

3. Senior Member
Join Date
Dec 1969
Posts
7,686

## RE: negative values

&#062;&#062; What&#039;s the DEFINITION of a negative value? <BR><BR>Less than 0 <BR>

4. Senior Member
Join Date
Dec 1969
Posts
16,931

## RE: negative values

Exactly. A negative value is a value less than zero.<BR><BR>So... How do you test if something is less than zero in JavaScript...?<BR><BR>(Am trying to spoon-feed this to him, but not to the code for him).<BR><BR>Craig.

5. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Haha. LOL!

I think Craug was directing that at Poopie and encouraging him to think....<BR><BR>

6. Senior Member
Join Date
Dec 1969
Posts
7,686

## RE: Haha. LOL!

LOL, I know<BR><BR><BR>I&#039;m sooooo ready for weekend....

7. Senior Member
Join Date
Dec 1969
Posts
16,931

## RE: Haha. LOL!

Me too... Have been working for 14 hours the last couple of days.<BR><BR>Just want to go buy my new big-screen TV and watch some DVDs or sport. Aint it the FA cup this weekend?<BR><BR>Craig.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•