• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

updating session variable on onChange event

 
Priya Lavti
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want to update JSP session variable on onchange event of a dropdown. Please note that I am not submitting the form with this event, so I can not use hidden form Inputs. Looking forward for other solutions.

~Pinks
 
Scheepers de Bruin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about:

onchange="window.open('http://urlThatNotifiesServerToUpdateSession?newValue=nv');"

Upon receiving the request, update the variable and send the client a page that'll close it:
<body on_load='window.close();'>
(without the underscore)
 
Priya Lavti
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the quick reply Bruin
but it will open a new window, that I can't do in my project.
Is there any other solutions...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must submit a request back to the server in order to update the server-side session. You could do this without opening a new window or refreshing the current page by either submitting a request to a hidden iframe or by using the XMLHttpRequest javascript object (doing so has come to be termed 'Ajax' technology).
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic