-2

I have a small query, I have a multiple dropdown box in my form. after selecting multiple value, if I click on outside the multiple drop down box page should reload. How can I make it happen using javascript. I have used "onmouseout(reload.form)" option but it is not working. Please help me on this.

Thanks Ranjith

2 Answers2

0

In this scenario, you might need click event rather mouseout(which is not on click but when mouse loses the focus).

For more details about click outside the element refer the below link

Javascript Detect Click event outside of div

So once you capture the click out event, you can just trigger the page load using

window.location.reload(true) or window.location.reload(false)

true or false depends on you need to load from cache or server.

Hope it helps!!

Community
  • 1
  • 1
  • Thanks for the response. I go through the link you provided above, but my query is If I click anywhere in the page, that page should reload with parameters. Could you please help me on this? – ranjith h l Jan 22 '16 at 09:27
0

Seems like you should really connect to the change() signal on the select box instead. By depending on the mouse event, you will prevent people form using your form with the keyboard only, for instance. onmouseout will also not work on mobile devices

manuBriot
  • 2,755
  • 13
  • 21