-
Button Counter in JSP
Hi all,
I have a requirement, where i want store the counter varibale and reuse the same in my code(java).
i have one Button, and i want to know how many times it was clicked, based on that i have to perform some actions.
for example
if counter = 1{
do some thing}
if counter =2{
do something}
etc..
Could you please any one help on this requirement.
thanks in Advance
-
You posted in the wrong forum - this forum is for JavaScript, not Java.
Java Forum
-
Button Counter
Hi
i have the following requirement
xxx.jsp
<form name="f1" id="f1" method="post"
action="<%= Do some action%>">
<input name="b1" class="submit" type="button" value="b1" onclick="javascript: submitForm();"/>
</form>
<script type="text/javascript">
//<![CDATA[
function submitForm() {
document.getElementById("f112").submit();
return false;
}
//]]>
</script>
in the above code i want to create one counter variable in java script to count the b1 button , how amny times it was clicked.
and that counter variable stored in session, reuse it in next pages.
please suggest me how to code..
thanks in advance