How can I prevent onbeforeunload from being called when clicking the submit button?
$(document).ready(function()
{
$('input:text,input:checkbox,input:radio,textarea,select').one('change', function()
{
//('BODY').attr('onbeforeunload',"return 'Leaving this page will cause any unsaved data to be lost.';");
if(
window.onbeforeunload = function() { return 'You have unsaved changes!'; }
});
});