How to submit the form on click of button to call function inside javascript call with all information of form given below. I am using struts core tag library and add button tag. Below is the code
<body>
<html:form action="createtableAction.do?param=uploadExcelFile1" method="post" enctype="multipart/form-data">
<table>
<tr>
<td align="left" colspan="1" class="migrate">
<html:file property="filename" styleId="filename" style="background-color:lightgoldenrodyellow; color:black;" />
</td>
</tr>
<tr style="width:100%">
<td align="center" colspan="2" class="migrate">
<html:submit onclick="return Checkfiles()" style="background-color:silver; color:darkblue;">Upload File</html:submit>
</td>
</tr>
</table>
</html:form>
</body>
in function call action and submit
function Checkfiles() {
if (fileList[count] === tempFileName) {
//want action and form submit code ...
//document.forms[0].action='/createtableAction.do?param=uploadExcelFile1';
//document.forms[0].submit();
return true;
} else {
return false;
}
}