0

Currently I have my code working so that if one were to click on a radio button, the url will change and I can paste that url in a different tab and have the same button checked that was in the previous tab.

I did that in my jsp with the following code:

<%= "BoxOne".equals(boxOne) ? "checked=\"true\"" : "" %> 

I want to do the same with a drop down menu such that when I select the item from the drop down menu the url is changing and I can paste that URL in a different tab and have that item that I selected from the drop down menu to show up?

How can I do that in terms of my drop down variable is drop and I do not know what to use instead of the "checked=\"true\"" for a drop down?

  • Instead of changing the url with location.href you can do a submit of a form and give the form target=_blank – developerwjk Jun 18 '14 at 19:41
  • @developerwjk _blank means open the result in a new tab/window. – Cruncher Jun 18 '14 at 19:47
  • possible duplicate of [Changing URL without refresh?](http://stackoverflow.com/questions/17166523/changing-url-without-refresh) – Cruncher Jun 18 '14 at 19:49
  • @Cruncher, Yep, see the part of the question that says "paste that URL in a different tab" – developerwjk Jun 18 '14 at 19:49
  • @developerwjk He doesn't want every time he changes the dropdown, for a new tab to open. He just wants to edit the URL such that if he were to paste it into a new tab at any time it would retain state. – Cruncher Jun 18 '14 at 19:50
  • I retracted my close vote, because I realised I really don't know enough about JSP to make that call. But it's worth looking at that question if you didn't already know about the history API of HTML5 – Cruncher Jun 18 '14 at 19:57

0 Answers0