I don't know how to get the value of a display:column in a JSP page to check in a JS function.
JSP Page:
<display:table>
...
<display:column property="surnameName" title="Surname, Name" />
<display:column property="type" title="Type"/>
....
</display:table>
JS function:
function next2(){
...
var type = $('.type').val(); //Obtain an undefined value
...
if (documents.length > 1 && (type=='Mail Addresss' || type=='Ordinary')) {
alert("You must select at least a PDF for Mail Addresss or Ordinary type for the stakeholder");
return false;
}
...
}
Replace '.your-table-selector' with the appropriate selector for your table. This code assumes that the type values are displayed in the second column of your table. Adjust the index in td:eq() if the column position is different.
This JavaScript function will extract all the type values from the displayed table rows and perform the necessary validation based on the conditions you've specified.