JavaScript form submit WITH a field called submit

后端 未结 1 778
说谎
说谎 2020-12-02 02:26

I was wondering if there is any method (using JS or otherwise) to autosubmit a form with a field with name and id as \'submit\'. Essentially, my entire HTML code looks like

相关标签:
1条回答
  • 2020-12-02 03:26

    The submit function for that form is completely inaccessible (it has been overwritten). You can steal one from another form though.

    document.createElement('form').submit.call(document.getElementById('myform'))
    

    Doesn't work in old-IE. (I think support appears from IE7 onwards)

    0 讨论(0)
提交回复
热议问题