TypeError: 'stepUp' called on an object that does not implement interface HTMLInputElement

前端 未结 2 1090
萌比男神i
萌比男神i 2020-12-03 01:07

I have an error in my use of AJAX:

TypeError: \'stepUp\' called on an object that does not implement interface HTMLInputElement....plete\",[C,p]),--x.

相关标签:
2条回答
  • 2020-12-03 01:39

    You will get all the checkbox values like following.

    var newvalue='';
    $('input[name=wordid\\[\\]]').each(function(index, element) {
                            newvalue=newvalue+this.value+',';
                        });
    

    Then pass the value of variable 'newvalue' to the assign.php file. Hope this may help you.

    0 讨论(0)
  • 2020-12-03 01:47

    $.ajax is not expecting a DOMElement of type HTMLInputElement in the object you are passing to data. Try just giving it the value of the field instead:

    var wordid = $('.wordId').val();
    $.ajax({
        url: "assigner.php",
        type: "POST",
        data: { wordid: wordid, assign: assign}
    }).done(function( e ) {
        /*alert( "word was saved" + e );*/
    });
    
    0 讨论(0)
提交回复
热议问题