![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Retired
|
Placing Javascript function arguments into objects
Ok, so here is what I want to do. I want to take the argument "1" and place it into the form reference object like this.
function calc( i){ document.form.quantity i.value } ... ... <input type="text" onFocus="calc( 1)"> This is what I've tried: document.form.quantity[i].value var quantity = 'document.form.quantity' + i + '.value' document.form[quantity[i]].value document.form.quantity+i.value document.form.[quantity[i]].value I realize some of those aren't proper sytax, but I was getting desperate. The only thing that gets atleast halfway is the second example, but that just makes is a string. I need it to retain it's object functionality. Any ideas? Or if you know how I can turn a string back into an object, that would work also. Many thanks in advance.
__________________
Last edited by gamerman0203; 09-06-2006 at 01:17 PM. Reason: made less confusing |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
![]() |
| Thread Tools | |
|
|