I have 2 problems:
1. I am embedding JavaScript in
JSP to check the value of a text box as following :
function Check()
{
var n =<%= Integer.parseInt((
String)request.getAttribute("quantity"))%>
if(1 > n > 20)
alert(" Please enter valid number");
}
please let me know if this is the right way to embed the javascript.. and do
java code need to be in <% --code-- %> in the aboce script. help would be greately appreciated.
2. when i click on the refresh button on the browser, it submits the form again. Is there a way so that form is not submitted on clicking refresh button.
looking forward to your help. .thanks