Strange Problem With This Script - Help Please

Discussion in 'JavaScript' started by pixelperfectdesigner, Jun 24, 2008.

  1. #1
    Hello,

    Can anyone see anything wrong with this function? I keep getting this error from firebug: missing ) after for-loop control


    function resetAllInput() {
    var allFields = document.getElementsByTagName("input");

    for ( i=0; i<allFields.length; i++; ) {
    allFields.setAttribute("id","userfile");
    }
    }
     
    pixelperfectdesigner, Jun 24, 2008 IP
  2. Ulquiorra

    Ulquiorra Peon

    Messages:
    422
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There is an extra ; after i++ in:

     
    Ulquiorra, Jun 24, 2008 IP
  3. pixelperfectdesigner

    pixelperfectdesigner Banned

    Messages:
    495
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i knew it's something small like this, wasted almost 2 hours on this damn thing, need more coffee............ thanks ulquiorra
     
    pixelperfectdesigner, Jun 24, 2008 IP