|
|
|
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
counter to add everytime user clicks on a button
how do i do a jsp program that counts how many times a user clicks on a button???
or how do i do a jsp program that adds a number to a generated file every time he clicks on a generate button. eg when the user clicks the first time, the generated file will be named as abc1 but when the user clicks on it the second time, it will change to abc2... Pls reply asap... |
|
#2
|
|||
|
|||
|
First, you need to store your counter somewhere persistent. That means the session object, the request object, or a hidden form field.
With the session: session.setAttribute("counter", session.getAttribute("counter")++); |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > counter to add everytime user clicks on a button |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|