title: Trying to call two functions on the same input field but only calls one
body: <p>I have two working functions which I want to assign to two inputs:</p>
  
  <pre><code>&lt;input type="text" id="start0" value="0" name="start[]" onkeyup="displayTotal();"/&gt;
  &lt;input type="text" id="end0" value="0" name="end[]"  onkeyup="displayTotal();"/&gt;
  </code></pre>
  
  <p>I would like to be able to use a displayHoras(); onkeyup for those two too. (2 many 2s on this thread already). when I use displayHoras(); instead of displayTotal(); it works, but when I call both of them like this it doesnt:</p>
  
  <pre><code>&lt;input type="text" id="start0" value="0" name="start[]" onkeyup="displayTotal();displayHoras();"/&gt;
  &lt;input type="text" id="end0" value="0" name="end[]"  onkeyup="displayTotal();displayHoras();"/&gt;
  </code></pre>
  
  <p>Any help will be welcomed.</p>
  
  <p>I'll share the code of both functions because...who knows? The problem might be there, right?</p>
  
  <pre><code>function displayTotal()
  {
     var tableRows = document.getElementById('budgetTable').getElementsByTagName('tr');
     var totalDays = tableRows.length - 3; //Don't count the header rows and the Total rows
  
     var totalPrice = 0;
  
     var price = filterNum(document.getElementById( 'txtPrice' ).value);
     var totalField = document.getElementById( 'txtTotal' );
  
     var tempHours = 0;
     var tempTotal = 0; 
  
     for(var i = 0; i &lt; totalDays; i++)
     {
         tempHours = document.getElementById("end" + i).value - document.getElementById("start" + i).value;
         tempTotal = tempHours * price;
  
         document.getElementById("total" + i).innerHTML = formatCurrency(tempTotal);
         totalPrice += tempTotal;
     }
     totalField.value = formatCurrency(totalPrice*1.21); 
  }
  
  function displayHoras()
  {
      var tableRows = document.getElementById('budgetTable').getElementsByTagName('tr');
      var totalDays = tableRows.length - 3;
  
      var tempHours = 0;
      var tempTotal = 0;
  
      for(var i = 0; i &lt; totalDays; i++)
      {
         tempHours = document.getElementById("end" + i).value - document.getElementById("start" + i).value;
         document.getElementById("totalHoras" + i).innerHTML = tempHours;         
      }    
  }
  </code></pre>
  
  <p>EDIT: I added the functions that create the table below.</p>
  
  <pre><code>function keyUpCall() {displayHoras(); displayTotal();}
  function addRowToTable()
  {
      var tbl = document.getElementById('budgetTable');
      var lastRow = tbl.rows.length - 4;
      var iteration = lastRow;
      var entry = iteration - 1; //because we started with day0, etc 
      var row = tbl.insertRow(lastRow);
  
      // day cell
      var cellDay = row.insertCell(0);
      cellDay.appendChild(createInput('text','dia' + entry, '', keyUpCall, 'dia' + entry));
  
      // start cell
      var cellStart = row.insertCell(1);
      cellStart.appendChild(createInput('text','start' + entry, 0, keyUpCall, 'start' + entry));
  
      // end cell
      var cellEnd = row.insertCell(2);
      cellEnd.appendChild(createInput('text','end' + entry, 0, keyUpCall, 'end' + entry));
  
      // precio unitario
      var cellPrecioUnitario = row.insertCell(3);
      cellPrecioUnitario.appendChild(createInput('text', null, '$36', null, null));
  
      // total HOras
      var cellTotalHoras = row.insertCell(4);
      cellTotalHoras.id = 'totalHoras' + entry;
  
      // total cell
      var cellTotal = row.insertCell(5);
      cellTotal.id = 'total' + entry;
  
  }
  
  function createInput(type, id, value, action, name)
  {   
      var el = document.createElement('input');
      el.type = type;
      el.id = id;
      el.value = value;
      el.onkeyup = action;
      el.name = name;
      return el;
  }
  </code></pre>
  
  <p>At this point, the action is not even attached for some reason.</p>
  
  <p>Edit2: I SOLVED THE PROBLEM!!! IUPI!! it was this line: 
      var totalDays = tableRows.length - 3;</p>
  
  <p>In the previous version of this form I was using 3 extra rows, my client got me to add a couple extra ones for Tax and without Tax result. I changed it to:
      var totalDays = tableRows.length - 5;
  And that fixed it!</p>