In the servlet I am trying to get the value of the submit button in the form below using
JSP and Servlet are diffirent webmodule
Servlet code:
public static String getValue(String value) {
return (value != null) ? value.trim() : "";
}
String article_title =
Utilities.getValue(request.getParameter("txtArticleTitle"));
byte article_image_count = Utilities.getByteParam(request,"txtFileCount");
out.print("Title is: " + article_title+" ----- ");
out.print("File Count is: " + article_image_count);
JSP form:
<form action="" method="" enctype="multipart/form-data">
<textarea name="txtArticleTitle" rows="3" value="" placeholder=""></textarea>
<input id="filePost" type="file" hidden="true" onchange="setImagePost()">
<button type="button" class="btn btn-sm btn-default pull-right" onclick="submitArticleAE(this.form);"></button>
</form>
JS Code
function submitArticleAE(fn){
//to check input form
alert("Title is: "+fn.txtArticleTitle.value+" ---- File Count is: "+fn.txtFileCount.value);
if(checkArticleAE(fn)) submitForm(fn,"POST","/adv/article/upload");
}