I seem to be having issues with the following code. I'm using a button to print another line of input fields. And the onkeyup is not working properly, and by not working properly it is not formatting the text as it should. not sure if im doing something wrong. It works in Chrome but not IE 11.
$(document).ready(function () {
var work_count = 0;
$("#addbutton").click(function () {
//Html to create a new field
var newField = "<tr class = 'project_type[" + work_count + "]'>\
<td style='text-align: center;'> \
<select name='f_types[]'><option value=''>-----Select----</option>\
<option value=''></option>\
<option value=''></option>\
<option value=''></option>\
<option value=''></option>\
<option value=''></option>\
</select>\
</td>\
<td style='text-align: center;'>\
<input type='text' name='proj_no[]' size='8' maxlength='7' value='' class='test' onkeyup='if (this.value.length==3) {this.value=this.value+'/'}' onkeypress='if (event.keyCode==45) {return false} else {return true}' onblur='if (this.value.length==6) {this.value=this.value+'X'}' placeholder='111-111' /> \
</td>\
<td style='text-align: center;'>\
<input type='text' name='box_number[]' placeholder='Required' value='' maxlength='7' size='8' />\
</td>\
<td colspan='3' style='text-align: center;'>\
<input type='text' name='comments[]' value='' placeholder='Comments Necessary for futrure reference' size='70' />\
<input type='button' id='removeButton' class='flatBtn' value='X' /></td>\
</tr>";
$("#work").after(newField);
work_count++;
$("#removeButton").on('click', function (events) {
$(this).parents('tr').remove();
});
});
//end of document.ready
});
Thanks in advance for helping me figure this out.