nimble: Verschobenes Feld

Beitrag lesen

Hi

aus dem nachfolgenden theCell.innerHTML schließe ich mal mutig, dass es sich bei theCell um eine DOM-Node innerhalb eines HTML-Dokumentes handelt. Kein mir bekanntes HTML-Element verfügt über ein option-Attribut.

Das schliesst du genau richtig. Das Feld Option wird vorher von mir gestetzt

Hier das ganze Script:

  
// Erstellung Tabelle  
 this.makeInputTable = function(root)  
 {  
  myform = document.createElement('form');  
  myform.action = 'input';  
  myform.target = 'status';  
  myform.method = 'post';  
  myform.setAttribute('id', 'bigform');  
   mytable = document.createElement('table');  
    mytablebody = document.createElement('tbody');  
      for(j = 0; j < root.firstChild.childNodes.length; j++)  
      {  
         mytablebody.appendChild(this.addRow(root.firstChild.childNodes[j], root.lastChild.childNodes[j]));  
      }  
      mytablebody.appendChild(this.submitButton());  
  mytable.appendChild(mytablebody);  
  mytable.className="table";  
  myform.appendChild(mytable);  
  return myform;  
 }  
  
// Erstellung Zeile (Row)  
this.addRow = function(titles, fields)  
 {  
  mycurrent_row = document.createElement('tr');  
  
  question_cell = document.createElement('td');  
  question_text = document.createTextNode(titles.text);  
  question_cell.appendChild(question_text);  
  question_cell.className = 'td';  
  mycurrent_row.appendChild(question_cell);  
  
  answer_cell = document.createElement('<td name="'+fields.text+'">');  
  answer_cell.setAttribute('inputtype', fields.getAttribute('inputtype'));  
  answer_cell.setAttribute('option', fields.getAttribute('option'));  
  answer_cell.setAttribute('id', 'newIn'+inId);  
  newInput = inmk.createCell(answer_cell);  
  answer_cell.appendChild(newInput);  
  answer_cell.appendChild(document.createTextNode(" "));  
  mycurrent_row.appendChild(answer_cell);  
  
  return mycurrent_row;  
 }  
  
// Check welches Feld:  
this.createCell = function(theCell)  
 {  
  switch (theCell.getAttribute('inputtype'))  
  {  
   case 'option.user':  
   case 'option.station':  
   case 'option.customer':  
    theInput = this.inputOption(theCell);  
    break;  
   case 'password':  
    theInput = this.inputPassword(theCell);  
    break;  
   case 'bigtext':  
    theInput = this.inputBigtext(theCell);  
    break;  
   case 'date':  
    theInput = this.inputDate(theCell);  
    break;  
   case 'chosebox':  
    theInput = this.inputChosebox(theCell);  
    break;  
   case 'hidden':  
    theinput = this.inputHidden(theCell);  
    break;  
   case 'hidden':  
    theInput = this.inputHidden(theCell);  
    break;  
   default:  
    theInput = this.inputText(theCell);  
  }  
  return theInput;  
 }  
  
// Erstellen des Feldes  
 this.inputHidden = function(theCell)  
 {  
  newInput = document.createElement('<input name="'+theCell.getAttribute('option')+'" readonly>');  
  newInput.type = 'text';  
  newInput.value = theCell.innerHTML;  
  return newInput;  
 }  

[...]verlinke die Seite, auf der das Problem betrachtet werden kann.

Wer das ganze mal live sehen will: geht [url=http://nimble.dyndns.info:8080/nmt@title:Hier] hin und meldet sich als ina/123 an. Das problem Tritt auf bei Pendenzen -> Neuer Eintrag

THX

--
ie:} fl:( br:> va:) ls:& fo:# rl:( n4:? ss:) de:] js:| ch:? sh:) mo:? zu:)
------------------------------
lieber ein Pinguin der läuft
als ein Fenster das hängt
------------------------------