My javascript code is like this :
$.ajax({
url:base_url+"agent_control/manage_booking/get_pax",
type: "post",
data: {id: id},
success:function(data) {
App.unblockUI();
var code = JSON.parse(data);
var isitable;
var j;
for(var i = 0; i < code.length; i++) {
j = i + 1;
isitable += '<tr>';
isitable += '<td>'+code[i].transactionpax_title+' '+code[i].transactionpax_firstname+' '+code[i].transactionpax_lastname+'</td>';
isitable += '<td><input type="text" id="tiket_number_'+i+'" class="form-control required" /></td>';
isitable += '</tr>';
}
isitable += '<tr><td> </td><td><input type="button" value="Submit" class="btn blue dropdown-toggle submit_tiket_number" id="'+id+'" data="'+code.length+'" /></td></tr>';
$("#data_tiket_number").find("tbody").html(isitable);
$('#data_tiket_number').modal('show');
}
});
Look here : <input type="text" id="tiket_number_'+i+'" class="form-control required" />
I had add required in text input. But it's not working
If the text input is empty, when I click submit there was no message required
Any solution to solve my problem?
Thank you very much
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…