I am currently working on a JSP that contains a JavaScript function:
function validateSelection(identifier, page) {
var form = ObjectId("profileForm");
form.elements['checkedLogin'].value = "" + identifier;
form.elements['pageList'].value = "" + page;
form.method.value = '<bean:message key="button.valid"/>';
window.location = "/STFPresentation/admin/userProfileSearch.do?method="
+ form.method.value + "&name=" + identifier + "&pageNum=" + page;
}
The function was functioning properly but I wanted to add a second parameter called "page". The variable "page" is also present in my JSP.
I trigger the JavaScript function by clicking on a link like this:
<a href="javascript:validateSelection('<core:out value="${item.name}"/>', '<%=page_number%>')"><core:out value="${item.name}" /></a>
However, upon clicking, nothing seems to happen. Where did I go wrong?
Thank you for your assistance!