php – TypeError:Value未实现接口HTMLInputElement
发布时间:2020-12-13 22:13:20  所属栏目:PHP教程  来源:网络整理 
            导读:我试图使用jQuery-ajax发布表单,并且我在点击时发布表单时收到此错误. ????TypeError:Value未实现接口 HTMLInputElement 这是我的 JavaScript代码: $('document').ready(function () { $('#update').click(function () { jQuery.post("update_category",{
                
                
                
            | 
                         
 我试图使用jQuery-ajax发布表单,并且我在点击时发布表单时收到此错误. 
  
????TypeError:Value未实现接口 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_id,c_name或c_description中的一个可能是表示输入字段的jQuery对象,而不是输入元素的.val()值.
 
        (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!  | 
                  
