java script problem
-
i have a java script confirm message box , which i am invoking at the page closing.The window is closing at both the buttons ok and cancel.y it is happening?how i can I keep the window open , ok clicking the cancel button.
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
-
i have a java script confirm message box , which i am invoking at the page closing.The window is closing at both the buttons ok and cancel.y it is happening?how i can I keep the window open , ok clicking the cancel button.
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
Did you consider using onBeforeUnload instead of confirm? http://msdn2.microsoft.com/en-us/library/ms536907.aspx[^]
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
i have a java script confirm message box , which i am invoking at the page closing.The window is closing at both the buttons ok and cancel.y it is happening?how i can I keep the window open , ok clicking the cancel button.
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
Hi here is the code..........
function close() { event.returnValue = "Any string value here forces a dialog box to appear before closing the window."; }
Regards, Sandeep Kumar.V
-
Did you consider using onBeforeUnload instead of confirm? http://msdn2.microsoft.com/en-us/library/ms536907.aspx[^]
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
in body tag , i am calling onBeforeUnload() = "abc();" function abc() { if( confirm('ok')) return true; still it does not keep the window open , while i am clicking the cancel button. }
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
-
in body tag , i am calling onBeforeUnload() = "abc();" function abc() { if( confirm('ok')) return true; still it does not keep the window open , while i am clicking the cancel button. }
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
Hi anthor way of doing the things.....
function close() { return window.confirm("Click ok to close"); }
Regards, Sandeep Kumar.V
-
Hi anthor way of doing the things.....
function close() { return window.confirm("Click ok to close"); }
Regards, Sandeep Kumar.V
even now, the moment , i click the cancel button, the window is vanishing. please help.
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
-
in body tag , i am calling onBeforeUnload() = "abc();" function abc() { if( confirm('ok')) return true; still it does not keep the window open , while i am clicking the cancel button. }
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
I think you're missing the else part of that if, where it will return false if not ok...
-
Hi anthor way of doing the things.....
function close() { return window.confirm("Click ok to close"); }
Regards, Sandeep Kumar.V
The
window
object already has a method namedclose
, so that is not a good method name.--- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams
-
in body tag , i am calling onBeforeUnload() = "abc();" function abc() { if( confirm('ok')) return true; still it does not keep the window open , while i am clicking the cancel button. }
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
Sonia Gupta wrote:
in body tag , i am calling onBeforeUnload() = "abc();"
Attributes in an html tag doesn't have parentheses. Also, you have to return the value from the function call to the event:
onbeforeunload="return abc();"
--- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams
-
Hi here is the code..........
function close() { event.returnValue = "Any string value here forces a dialog box to appear before closing the window."; }
Regards, Sandeep Kumar.V
Sandeep Kumar Vuppala wrote:
function close()
(Not a good name, but I already mentioned that elsewhere in the thread.)
Sandeep Kumar Vuppala wrote:
event.returnValue
The window.event object only exists in Internet Explorer. Just return the value from the function:
function closingMessage() {
return "Any string value here forces a dialog box to appear before closing the window.";
}Sandeep Kumar Vuppala wrote:
You have to pass the value returned from the function on to the event:
onbeforeunload="return closingMessage();"
--- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams