gpt4 book ai didi

php - 类型错误 : Value does not implement interface HTMLInputElement

转载 作者:可可西里 更新时间:2023-10-31 23:53:46 24 4
gpt4 key购买 nike

我正在尝试使用 jQuery-ajax 发布表单,但在点击发布表单时出现此错误。 TypeError:值未实现接口(interface) HTMLInputElement这是我的 JavaScript 代码:

 $('document').ready(function () {
$('#update').click(function () {
jQuery.post("update_category", {
c_id: c_id,
c_name: c_name,
c_description: c_description
},

function (data, textStatus) {
if (data == 1) {
$('#response').html("Thank You!!..We Will Get Back To You Soon..!!");
$('#response').css('color', 'green');
} else {
$('#response').html("Some Error Occurred");
$('#response').css('color', 'red');
}
});
});
});

我的表格:

<div id="form">
<form>
<!-- PRONT DROP DOWN HERE !-->
<input type="text" name="c_id" id="c_id" disabled="disble" placeholder="'.strtoupper($r['c_id']).'" value="'.strtoupper($r['c_id']).'" ></input>
<input type="text" name="c_name" id="c_name" disabled="disble" placeholder="'.strtoupper($r['c_name']).'" value="'.strtoupper($r['c_name']).'"></input>
<textarea rows="4" class="field span10" name="c_description" id="c_description" disabled="disble" placeholder="Description">'.strtoupper($r['c_description']).'</textarea>

</form>
</div>

最佳答案

如果您在 ajax 请求中发送 jQuery 对象,则会生成此错误。因此,在您的情况下,c_idc_namec_description 之一很可能是表示输入字段的 jQuery 对象,而不是 .val() 输入元素的值。

关于php - 类型错误 : Value does not implement interface HTMLInputElement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17970648/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com