-1

this is my javascript code

$(document).ready(function() {
    var count = 0;

$("#add_btn").click(function(){
        count += 1;
    $('#container').append(
        '<table align="left" style="padding-left:120px; color:#6B1313; width:700px;" class="records">'
            +'<tr>'
                +'<td></td>'
                +'<td>Only Alphabet</td>'
                +'<td><input type="text" id="only_alphabet" name="only_alphabet" required ="required" onblur="number_validation()"/></td>'
            +'</tr>'
        +'</table>'
    );
});
});

but i couldn't call number_validation javascript function, and onblur event doesn't run as i expected. So could anyone help me to solve this? Thanks

Satrio
  • 1

1 Answers1

0
var count = 0;

$(document).ready(function() {

$("#add_btn").click(function(){

        count += 1;

    $('#container').append(
        '<table align="left" style="padding-left:120px; color:#6B1313; width:700px;" class="records">'
            +'<tr>'
                +'<td></td>'
                +'<td>Only Alphabet</td>'
                +'<td><input type="text" id="only_alphabet" name="only_alphabet" required ="required"  /></td>'
            +'</tr>'
        +'</table>'
    );

   $('#only_alphabet').live('blur',function(){

  number_validation();

});

});



});
Kodr.F
  • 13,932
  • 13
  • 46
  • 91