简体   繁体   中英

submit a form using external js

How to submit a form using external js ? using form name or id is not working, Showing this error TypeError: document.forms.adminForm.submit is not a function

document.forms["adminForm"].submit();

adminForm is name & id of the form

TypeError: document.forms.adminForm.submit is not a function

means that you named your submit button or some other element as 'submit'. Rename the button to something else and your code will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM