JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 7th, 2005, 03:34 PM
SABmore SABmore is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 17 SABmore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 34 sec
Reputation Power: 0
NaN & concatenate???

I'm printing a table to the screen with x number of rows. As each row is put out, I update form objects by appending the value of x to them. For example (rough):

x=1
do while....
<input type=text name="Test & <%=x%>">
x = x+1
next

When I click on a form object, I call a function in which I pass the value of x. I then want concatenate x with the name of the form object. For example:

function testMe(x)

var s = (document.form.Test+x)

But each time I get NaN as the form object. What am I doing wrong? Thanks!

Reply With Quote
  #2  
Old July 28th, 2005, 08:28 AM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Click here for more information
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 549 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 7 h 3 m
Reputation Power: 4
NaN

the variable x is being cast as a string.
put some of these in your script to find out where it's changing type:
Code:
alert("x is: " + x);

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > NaN & concatenate???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT