有人可以帮我这个,每当我点击添加按钮,它就不会保存到mysql中。即使我去检查元素,也没有出现错误,它只是没有反应。
<form action='' method='POST' id='form_client_log' enctype='application/x-www/form-urlencoded'>
<div id="myModal" class="modal modal-primary">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Quick Event</h4>
</div>
<div class="modal-body" id= 'result'>
我尝试隐藏所有的input_text以了解它是否已添加到mysql中
</div>
<div class="modal-body">
<?php //input_text('contact_person', 'Contact Person', false);?> 
<?php //input_text('company', 'Company', false);?><br><br>
<?php// input_text('email', 'Email', false);?> 
<?php //input_text('contact_no', 'Contact Number', false);?><br><br>
<!-- Date: <input type='date' name='continue_date' id='continue_date'><br><br>
Note: <textarea name='remarks' id='remarks' row='4' cols='100'></textarea>-->
<?php input_hidden(); ?>
<input type="text" id="contact_no" name="contact_no" placeholder="Insert Number"/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn" name='add' id='add' title='Add'></button>
<button type="button" class='btn' name='delete' id='delete' title='Delete'></button>
</div>
</div>
</div>
</div>
</form>
这是用于添加的JavaScript的代码..
var client_logUI = "";
var client_log = new BizObject("client_log", function(){
client_log = new BizObjectUI(client_log);
});
//create BizObject also for every foreign table source
$(document).ready(function(){
$( "#tabs" ).tabs();
$("#tabs").tabs("option", "active", 0);
$("#date_rel").datepicker(pickerOpts);
$("#date_rel").datepicker("setDate", "today");
$("#date_rel_search").datepicker(pickerOpts);
setup_button_events("client_log", client_log, client_logUI);
});
client_log.after_new = function (){
$("#id").val(client_log.data['id']);
}
client_log.after_add = function(){
show_save_result(this);
}
client_log.after_update = function (){
show_save_result(this);
}
client_log.after_delete = function ()
{
show_save_result(this);
reset_fields("form_client_log");
$("#btn_search").click();
}
client_log.after_select = function ()
{
client_logUI.edit();
//display values from foreign table here
$("#message").html("");
$("#btn_update").show();
$("#btn_delete").show();
}
client_log.is_valid = function()
{
var fields = new Array('id','contact_person','company','email','contact_no','remarks');
var field_labels = new Array('Contact Person','Company','Email','Contact Number','Note');
var valid = is_valid("form_client_log", fields, field_labels);
return valid;
}