• Post Reply Bookmark Topic Watch Topic
  • New Topic

Global variables?  RSS feed

 
shanon jis
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 3 buttons on my page.
Btn A
Btn B
Btn C (Done Btn)

I have to store the value of each btn the user clicked. Once he is done I have to display on the page the various btns he had clicked.
How to do this?

I know, I need a global variable that would store all the btn values the user clicked. But I don't know how to make the variable global? please help
 
AnishK George
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi shanon,

If you are going to stand in the page itself, you can just declare a javascript array variable globally(not inside any function), and keep adding to the button values to the array.

If you are submitting the page each time, then you will have to either keep a static list or session variable somewhere. Or one more way is you can just store the previously selected button values as hidden text boxes in the screen each time. So you can keep adding to that.

Thanx and Regards,
Anish K George
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!