#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    1
    Rep Power
    0
    Hello!

    The following line does what I want it to. Namely, it puts the value of newval into the field specified.
    document.forms[1].Ship1[3].value = newval;

    However, I need to do this dynamically.
    I have been trying (to no avail) things like this:
    document.forms[1].Ship + var1 + [ + var2 + ].value = newval;

    Any advice/suggestions about how to go about this would be greatly appreciated.
    TIA,
    Sven
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Location
    Netherlands
    Posts
    77
    Rep Power
    15
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Thermidor:
    Hello!

    The following line does what I want it to. Namely, it puts the value of newval into the field specified.
    document.forms[1].Ship1[3].value = newval;

    However, I need to do this dynamically.
    I have been trying (to no avail) things like this:
    document.forms[1].Ship + var1 + [ + var2 + ].value = newval;

    Any advice/suggestions about how to go about this would be greatly appreciated.
    TIA,
    Sven
    [/quote]

    Try it with eval("document.forms[1].Ship" + var1 + "[" + var2 + "]" + ".value = newval");

    Peter


    [This message has been edited by PAV (edited April 10, 2000).]

Similar Threads

  1. Calculating values from generated input field
    By Ct'zen in forum HTML Programming
    Replies: 2
    Last Post: October 3rd, 2003, 06:01 AM
  2. Replies: 0
    Last Post: September 10th, 2003, 03:26 AM
  3. Replies: 18
    Last Post: August 28th, 2003, 07:48 AM
  4. Dynamically populating a form field
    By WellsGroup in forum HTML Programming
    Replies: 1
    Last Post: June 24th, 2003, 12:32 PM
  5. Checking a field entry of numeric values?
    By Maglight in forum Perl Programming
    Replies: 2
    Last Post: November 11th, 2001, 08:15 AM

IMN logo majestic logo threadwatch logo seochat tools logo