Skip to content
Snippets Groups Projects
Commit 630b87e8 authored by Peter Rotich's avatar Peter Rotich
Browse files

Add discard warning, Add auto-submit on setting options change

parent 27959672
Branches
Tags
No related merge requests found
......@@ -87,6 +87,9 @@ $(document).ready(function(){
if(!fObj.data('changed')){
fObj.data('changed', true);
$('input[type=submit]', fObj).css('color', 'red');
$(window).bind('beforeunload', function(e) {
return 'Are you sure you want to leave? Any changes or info you\'ve entered will be discarded!';
});
}
});
......@@ -97,9 +100,19 @@ $(document).ready(function(){
$('label', fObj).removeAttr('style');
$('label', fObj).removeClass('strike');
fObj.data('changed', false);
$(window).unbind('beforeunload');
}
});
$('form#save').submit(function() {
$(window).unbind('beforeunload');
return true;
});
$('select#setting_options').change(function() {
$(this).closest('form').submit();
});
$(".clearrule").live('click',function() {
$(this).closest("tr").find(":input").val('');
......
......@@ -44,7 +44,7 @@ require(STAFFINC_DIR.'header.inc.php');
<div style="padding-top:10px;padding-bottom:5px;">
<form method="get" action="settings.php">
Setting Option:
<select name="t" style="width:300px;">
<select id="setting_options" name="t" style="width:300px;">
<option value="">&mdash; Select Setting Group &mdash;</option>
<?php
foreach($SettingOptions as $k=>$v) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment