TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hari B
NA
139
67.8k
Warning Message Popup
May 26 2015 12:56 AM
Hello All,
Here I have one web page like create. suddenly if i click on other tab need to show warining message like are sure want to leave
this is my code:
<script type="text/javascript" language="javascript">
window.addEventListener("beforeunload", function (e) {
var confirmationMessage = 'It looks like you have been editing something.';
confirmationMessage += 'If you leave before saving, your changes will be lost.';
(e || window.event).returnValue = confirmationMessage;
return confirmationMessage;
});
</script>
But my problem if i fill all fields and submit i got error message for above code. i Need to get warning message only if i click other page or other tab
Please help...
Thanks in advance
Reply
Answers (
3
)
JavaScript stops other Scripts on the Page
Unique Items in output value using Jquery