0
我要救四個字段上點擊一個文本框保存數據的兩個複選框和一個wysihtml5Editor用ajax這些都是如下:用ajax
<input type="text" id="title" name="title" required title="required" placeholder="title" data-bind="value:title" />
<input type="checkbox" id="active" name="active" class="check" data-bind="checked: active=='true'" />Active
<input type="checkbox" id="logon" name="logon" class="check" data-bind="checked: use_logo=='true'" />Logo
<textarea id="iiii" name="iiii" class="htmleditor" rows="9" cols="50" style="width: 600px; height: 190px;"></textarea>
<button type="button" name="save" id="save" class="btn btn-primary">Save</button>
我的表名是contracts
和字段名都作爲如下:
title(textbox),def_next(wysihtml5Editor),active(checkbox),use_logo(checkbox)
,我的條件如下這樣做:
if ($_POST['what']=="save"){}
和我已經嘗試阿賈克斯作爲
$.ajax({
type: 'POST',
url: root + 'data/comapanydata_contractorslist?json',
data: {
what: "save",
text: $('#iiii').val(),
def_text: def_text
},
success: function (data) {},
dataType: 'json'
});
但不能正常工作,所以請建議我對此。
什麼不工作,米什拉吉? –
「不工作」,如JS或PHP錯誤,或...? – nnnnnn
顯示'if($ _POST ['what'] ==「save」){}內部的代碼。 –