views:

1214

answers:

2

When using onbeforeunload function, I don't want to show warning message for submit button and some other buttons also inside my form. I am checking boolean[T/F] condition to fire it. It works with IE, but it seems not checking the condition in FireFox. It is showing problem. Can somebody help.

Thanks

+3  A: 

I am not 100% sure I understand what you mean, but it appears you just trying to do something you shouldn't.

If I understood correctly, you are trying to use the onbeforeunload event without a warning message. Think about it for a moment. You'll probably see that see that someone that does not have your best interest at heart could keep you at his site and make it impossible for you to leave. That's why firefox doesn't allow you to do it - and that's something to be happy with!

Jasper
A: 

This technique worked for me in IE and Firefox. You aren't trying to bypass the warning message as another answer suggested, you just don't want the warning message on the buttons which makes perfect sense.

Leslie