This is a javascript question, more appropriate for a list dealing in it,
but here's something that might work:
<script type="tetx/javacsript">
var glbBlnNothingthingChanged = true;
</script>
Set the onchange attribute of all form fields to set the global boolean to
false:
<input type="text" .... onchange="glbBlnNothingthingChanged = false;">
and the onclick of all links o return the boolean:
<a href="xyz.jsp" onclick="return glbBlnNothingthingChanged">Click me</a>
> From: sanjib B <[EMAIL PROTECTED]>
> Reply-To: A mailing list about Java Server Pages specification and reference
> <[EMAIL PROTECTED]>
> Date: Thu, 28 Feb 2002 12:00:50 -0700
> To: [EMAIL PROTECTED]
> Subject: Leaving the JSP page
>
> Hi All,
> In my JSP page I have some editable fields which the user can edit but before
> applying those changes to database updates, if the user clicks some other link
> or wants to leave the page I want to prevent the user from doing so and wnats
> to show a message box. If the user presses "Ok" and want to discard the
> previous edits then only I want to allow the user to leave the page. How do I
> do so? any idea ??
>
> thanks
> sanjib
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com