This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes how to clear multibox selection on browser back Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to clear multibox selection on browser back" Watch "how to clear multibox selection on browser back" New topic
Author

how to clear multibox selection on browser back

sri kota
Greenhorn

Joined: Mar 21, 2008
Posts: 3
Hi,


I have a page where i show up different options to select. I am holding the selection using multibox. On submit of the page, I use these values to show the details of the selection.
I am doing a check on minimum selection onsubmit in javascript.
this check uses a global variable count to check the count of the selection.

When the user hits browser back, the multibox selection is retained but, the count is zero.. so my minimum check never allows me to submit the form.
I want to clear the selection of the multibox when the user hits the browser back to go back to previous page(jsp).

Any suggestion?

Thanks in advance

-
sri
Jagdeep Sharma
Ranch Hand

Joined: May 24, 2010
Posts: 121

sri kota wrote:Hi,


I have a page where i show up different options to select. I am holding the selection using multibox. On submit of the page, I use these values to show the details of the selection.
I am doing a check on minimum selection onsubmit in javascript.
this check uses a global variable count to check the count of the selection.

When the user hits browser back, the multibox selection is retained but, the count is zero.. so my minimum check never allows me to submit the form.
I want to clear the selection of the multibox when the user hits the browser back to go back to previous page(jsp).

Any suggestion?

Thanks in advance

-
sri



Please show your code
Prashant Mak
Greenhorn

Joined: Nov 13, 2009
Posts: 4
You can try something, like

window.setTimeout(yourMethod,1000);
function yourMethod()
{
document.getElementById('combobox').value='0'; //for e.g
}

yourMethod() will be called, after the page loads.


 
 
subject: how to clear multibox selection on browser back
 
Similar Threads
Display tag and Struts multibox tag
multibox - nullPointerException
multibox functionality in struts
struts and multibox
Iterator and multibox