Hi,
Requirement:
if any value of control change a flaf "dirty" is set to true else it is false. When user leave that page and if dirty flag is true. He is asked to save records or close window without saving.
We are using below script to find dirty flag for all the controls.
Above script is working fine with all input controls except hidden fields. Specifically RadComboBox and RadDatePicker are using hidden fields to post data.
Could you please provide solution so that we can check dirty flag with rad controls ?
Requirement:
if any value of control change a flaf "dirty" is set to true else it is false. When user leave that page and if dirty flag is true. He is asked to save records or close window without saving.
We are using below script to find dirty flag for all the controls.
<script> var isDirty = false; var resetControls = ""; // should be in , separated with # in ids var msg = 'You haven\'t saved your changes.\n Do you want to save changes ?'; $(document).ready(function () { alert($(".section :hidden").length); $(":submit,:reset ").click(function () { isDirty = false; alert("Dirty flag reset"); }); $(':input').change(function () { if (!isDirty) { alert("Dirty flag set") isDirty = true; } }); window.onbeforeunload = function () { if (isDirty) { return msg; } }; }); </script>
Above script is working fine with all input controls except hidden fields. Specifically RadComboBox and RadDatePicker are using hidden fields to post data.
Could you please provide solution so that we can check dirty flag with rad controls ?