I need to read a variable and then have to pass that as an argument to a function after onclick(). I am using JSP, so I am reading the variable using scriptlets
<% int lateRegDays = 6;%>
I am passing the variable as
onclick="displayDatePicker('startTestAdminNo','mdy',<%=lateRegdays %>,120,0,3);"
But, I am unable to pass the valueof 6. The string "<%=lateRegDays%>" is being passed to the function. However, when I tried to print the value using alert, it worked. The changes I did is,
onclick='<%="alert("+lateRegDays+")"%>'
In the similar fashion, I need to know, how to pass all my arguments to function with this scriptlet variable. The entire code snippet is:
<td><input name="startTestAdminNo"></td>
<td>
<chtml:img srcKey="order.calendar.search" onclick="displayDatePicker('startTestAdminNo','mdy',<%=lateRegdays %>,120,0,3);"
altKey="order.calendar.alt_search" bundle="prompt" />
</td>
I need help with this as I am stuckand I don't know how to pass multiple arguments along with a scriptlet variable