[HELP]Javascript code on Firefox

  • epoy
  • Newbie
  • Newbie
  • epoy
  • Posts: 13
  • Loc: Phillipines

Post 3+ Months Ago

I need a help on my javascript code, I found out that this code don't work on mozilla firefox 3.0.11. It cannot read or process the lines document.getElementById('resultID'+id).getElementsByTagName('TD');
where I used 'resultID' and a variable named id, example: the if the id=12 it should output resultID12 then get its value.

does anyone have an idea on how can i make this work? thanks in advance

Code: [ Select ]
 
//Update table properties
var lastId;
function showEditForm (id) {
    //toggle control
    alert("show edit form");
    if (lastId == id) {
        toggleObj('formEdit','off');
        lastId = '';
    } else {
        toggleObj('formEdit','on');
        lastId = id;
    }
    //send properties'
    var form = document.getElementById('fEdit');
    var e = document.getElementById('resultID'+id).getElementsByTagName('TD');
    var etdLength = e.length;
    for (var i=0;i<etdLength;i++){
        form.elements[i].value = e[i].innerHTML;
    }
    localEdit();
}
 
  1.  
  2. //Update table properties
  3. var lastId;
  4. function showEditForm (id) {
  5.     //toggle control
  6.     alert("show edit form");
  7.     if (lastId == id) {
  8.         toggleObj('formEdit','off');
  9.         lastId = '';
  10.     } else {
  11.         toggleObj('formEdit','on');
  12.         lastId = id;
  13.     }
  14.     //send properties'
  15.     var form = document.getElementById('fEdit');
  16.     var e = document.getElementById('resultID'+id).getElementsByTagName('TD');
  17.     var etdLength = e.length;
  18.     for (var i=0;i<etdLength;i++){
  19.         form.elements[i].value = e[i].innerHTML;
  20.     }
  21.     localEdit();
  22. }
  23.  
  • mk27
  • Proficient
  • Proficient
  • User avatar
  • Posts: 334

Post 3+ Months Ago

epoy wrote:
does anyone have an idea on how can i make this work? thanks in advance


Did you try splitting the line to check which part doesn't work, eg:
Code: [ Select ]
var e = document.getElementById('resultID'+id)
var eray = e.getElementsByTagName('TD');
  1. var e = document.getElementById('resultID'+id)
  2. var eray = e.getElementsByTagName('TD');

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 118 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.