Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-21-2012, 03:50 PM   PM User | #1
rlinkey
New to the CF scene

 
Join Date: Sep 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
rlinkey is an unknown quantity at this point
Get rid of -symbol

This is my script:
this.getField ("available hours").value = this.getField("hours used to date").value - this.getField("Text8").value;

however it shows the - sign how do I get ride of it?
rlinkey is offline   Reply With Quote
Old 09-21-2012, 03:55 PM   PM User | #2
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 960
Thanks: 7
Thanked 100 Times in 100 Posts
WolfShade is an unknown quantity at this point
parseInt()
__________________
^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
*
The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
WolfShade is offline   Reply With Quote
Old 09-21-2012, 03:59 PM   PM User | #3
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,098
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by WolfShade View Post
parseInt()
No. Math.abs()


Quizmaster: What was the name of King Henry VIII's warship raised in 1982?
Contestant: The Jolly Roger
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 09-21-2012, 07:20 PM   PM User | #4
mrhoo
Regular Coder

 
Join Date: Mar 2006
Posts: 710
Thanks: 31
Thanked 128 Times in 119 Posts
mrhoo will become famous soon enoughmrhoo will become famous soon enough
Philip's solution will remove the minus sign- but you should make sure you are subtracting the correct value.

Perhaps you should reverse the order in your expression.

this.getField ("available hours").value =
this.getField("Text8").value-this.getField("hours used to date").value;

Of course it depends on what your fields represent.
mrhoo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:25 AM.


Advertisement
Log in to turn off these ads.