javascript - Uncaught TypeError: object is not a function calling a function on change form input -
i error on this:
this function inside jscript.js source in section of index.php
function upd(ctd, id, pr){ //$('#sub'+ id).val() = ctd * pr; document.getelementbyid('sub'+ id).value = ctd * pr; }
i have form built dinamically. sample of 1 of inputs, id=4
this html inside div loaded ajax
150 times <input name="ct4" id="c4" type="text" value="10" onchange="upd(this.value,4,150);" /> =<span id="sub4">1500</span>
span
element doesnot have value attribute, change to:
document.getelementbyid('sub'+ id).innerhtml = ctd * pr;
see: updated fiddle
Comments
Post a Comment