can i disable control panel's close button?
hello there,
i want to execute a javascript function, when user closes the child window. for that, i've given a button in my code. when user clicks on it, i am calling a function which executes the code and then closes the window with self.close() method.
now, if user closes the window using the control panel's close button, then how can i restrict him?
can i disable control panel's close button?
i've tried to use Body Unload() event, but it doesn't serve my purpose. as, it will be fired every time the form in the window is submitted. Is there any event handler which can handle the window close event such as window close()?
any help would be appreciated.
thanks,
paras
Jack Michaelson posted this at 08:57 — 6th March 2001.
He has: 1,733 posts
Joined: Dec 1999
So basicly what you're trying to say is that you're looking for a function A that calls function B, unless the form is submitted. And function B has to execute the onUnload...
If that's what you mean, I can only say this:
Gee, that's heavy.
Th tricky part is where you have to check if the form is submitted, but my javascript-knowledge is too teenyweeny to help you out. But I hope this helped even a litte.
cul8r,
Shakespeare: onclick || !(onclick)
Mark Hensler posted this at 21:49 — 6th March 2001.
He has: 4,048 posts
Joined: Aug 2000
try something like this....
<script>
function my_function() {
if (my_form != "submited") {
//do something
}
}
</script>
<body onUnload="my_function()">
*blah*
<form onSubmit="my_form='submited'"></form>
code not perfected, but its a good start. Good Luck,
Mark Hensler
If there is no answer on Google, then there is no question.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.