I am trying to submit the form automatically with a delay in a chrome extension I am writing and it does not seem to be submitting. Below is my form and javascript:
function submitForm() { // submits form
document.getElementById("ismForm").submit();
}
if (document.getElementById("ismForm")) {
setTimeout("submitForm()", 5000); // set timout
}
<form method="post" id="ismForm" name="ismForm" action="http://www.test.com" class="">
<label for="searchBox">Search </label>
<input type="text" id="searchBox" name="q" value=""> <input type="hidden" id="sayTminLength" value="3"><input type="hidden" id="coDomain" value="US"><input class="button" type="submit" id="search.x" name="search.x" value="Search" autocomplete="off">
</form>