SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Adding a variable to document.formelement

    This is just a snippet of the function...
    but it's straightforward
    I just want to append document.question to
    be document.question(num)

    However, I can't seem to figure out how to add that variable to the document.... cause it's not like adding it to a string "bla" + num;


    Code:
    function validate(num) {
    
    if (document.layers)
    {
    
    var q1 = document.question.document.hurdle.q[0].checked;
    
    }

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    shouldn't question be an array like this?

    PHP Code:

    function validate(num) {

    if (
    document.layers)
    {

    var 
    q1 document.question[num].document.hurdle.q[0].checked;




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •