I need to pass the value from jsp file property in a loop. Here is the code
</tr>
<%
for (int i = 0; i < value.size(); i++) {
<html:form action="save" method="post" styleId="update" enctype="multipart/form-data">
<input type=hidden id="secfeaturetype" name="secfeaturetype" value="" />
<html:file property="testfile" styleId="testfile"/>
<input type="button" value="Update" onclick='javascript:check_updatefields()' />
</html:form>
</td>
</tr>
I am trying to do some validation in javascript and it is reading only the first file properly and not the rest. Any ideas ?
function check_updatefields() {
var file = jQuery('#testfile').val();
alert(testfile);
}
Am I missing something here ? Thanks.
"id", it means it's unique in your page, so if there's more than one, the browser will only identify the first element, so here you'd better use "class", correcting it like this: styleClass="testfile". js: jQuery('.testfile').