I have some jQuery code like this :
$(function($) {
$('input.autonumeric').autoNumeric({aSep: ',', aDec: '.',vMax:'1000000000000'}); });
with that code, every input text that have autonumeric-class can only input with numeric.
but when i write input text tag from innerHTML, it doesn’t work at all. this is how i write the code :
function edit(){
var current = window.event.srcElement;
while ( (current = current.parentElement) && current.tagName !="TR");
var row = current.childNodes;
td = row.item(0); var temp = td.innerHTML;
td.innerHTML = "<input type=\"text\" value=\""+temp+"\" class=\"autonumeric\" \>";
}
how can i solve this code? note: i’m sorry if my english not good enough.
you’ll have to run autoNumeric for the newly added Elements as well.
You could do it right at the creation of the new input like that:
or leave your version and run
again afterwards.