I have a form without any ID.
<form action="LoginServlet" method="post" onsubmit="return checkForm(this);">
How can I get the form to submit?
I only have on form on that page, so I tried this but it didn;t work.
document.forms[0].submit()
I have a form without any ID.
<form action="LoginServlet" method="post" onsubmit="return checkForm(this);">
How can I get the form to submit?
I only have on form on that page, so I tried this but it didn;t work.
document.forms[0].submit()
try this,tested ok according to the url you give:
document.getElementsByClassName('btn btn-primary')[0].click();
code below doesn't work because the website have an input whose name is 'submit'
document.forms[0].submit()
so ,when you execute
document.forms[0].submit//returns an input element,not a function
so,
document.forms[0].submit() //doesn't work,cause document.forms[0].submit is not a function
Try this:
document.getElementsByTagName('form')[0].submit();