Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to clear multibox selection on browser back

 
sri kota
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 121
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic