/    Sign up×
Community /Pin to ProfileBookmark

NaN error when string is passed.

Hello.
I’m having problems isolating a NaN error occurring in a prototype html/javascript page.

Quick overview on working the page…
1. Choose product code of “Ethernet Private Line” in the first combo box.
2. Choose protocol of “GIGE” in the second combo box.

After these 2 choices are selected, it’s suppose to look through the array and set the text box and text to a value from the array (“1 GBPS”). It is here where the NaN is occurring on those 2 fields. I just can’t figure it out.
My loading of the comboboxes works fine from these same arrays.

Any help would most be appreciated.
Thanks
Yours Truly
Frustrated.

txt file of page is attached…

[upl-file uuid=8d6ae4f8-7f00-41b4-9d69-77a1a0841bc7 size=14kB]wavelengthTest.txt[/upl-file]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@cgishackJan 19.2008 — Its because "quantity" is undefined.

See this part of the code
<i>
</i> if (quantity != ""){
var newSpeed = multiplySTSQuantityValue * [COLOR="Red"]quantity[/COLOR];
var LineSpeedTxt = document.getElementById("LineSpeedTxt");
LineSpeedTxt.firstChild.nodeValue=newSpeed;
document.all.tbLineSpeed.value=newSpeed;


Drew
Copy linkTweet thisAlerts:
@boy3696authorJan 19.2008 — Thanks Drew. That's what happens when you look at something for hours on end. You just don't see the obvious. I actually got it working last night as my mind wouldn't let me sleep as it was on my mind. I decided to clean all the script up and debug it line by line and your assumption was correct. It was also a few other things as well, but again, a lesson on why rushing to do things just don't work... ?

Once again, thanks for the reply.

Cheers.
Copy linkTweet thisAlerts:
@cgishackJan 19.2008 — If your not already, try using firebug for firefox.

it will save you hours of debugging

http://www.getfirebug.com/

Drew
×

Success!

Help @boy3696 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...