Question : how to auto submit  hidden field onunload

I need a hidden field value (variable) to be automatically submitted when the user navigates away from the page or refreshes the page, without the use of any submit button.
The idea is to capture this value and use it in php.
Can anybody help.

I have raised several questions on this without any success so far.

Answer : how to auto submit  hidden field onunload

yes, clearly the unload event is not working. I tried creating a form with the unload command you have on your script and then I navigate to a different page, which doesn't get the values at all. Maybe you should ask this question in the JavaScript zone? I am not very good as JavaScript. Maybe you are calling submit() incorrectly?
Random Solutions  
 
programming4us programming4us