You need to sign in to do that
Don't have an account?
ksmo
popup message on navigating from a page without saving
I have a text box and few checkboxes on the page. If the user enters,changes existing text,clciks or unclicks the checkbox and clicks the cancel button or navigates away from the page I want a pop-up message saying yor changes have not been saved
Define a boolean variable called isChanged
Add an actionSupport onchange event to both the textField and the Checkbox. On change call an apex method, the apex method will set the isChanged = true.
Now, in the apex method for Cancel button, redirect to the back page only if isChanged = false. If its true, you can show a message.
All Answers
Define a boolean variable called isChanged
Add an actionSupport onchange event to both the textField and the Checkbox. On change call an apex method, the apex method will set the isChanged = true.
Now, in the apex method for Cancel button, redirect to the back page only if isChanged = false. If its true, you can show a message.
For example, below is the code for my text box, Is there any javascript solution for this
<div class="textpanel">
<input type="text" name="txt" size="35" />
</div>