hide save button on successful form completion so we don't get a duplicate submit

This commit is contained in:
Isaac Connor 2018-02-27 15:10:20 -08:00
parent 83fad681b3
commit c5eec7e2fd
1 changed files with 2 additions and 2 deletions

View File

@ -519,7 +519,7 @@ foreach ( $tabs as $name=>$value ) {
?>
</ul>
<div class="clear"></div>
<form name="contentForm" id="contentForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onsubmit="return validateForm( this )">
<form name="contentForm" id="contentForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onsubmit="if(validateForm(this)){$j('#contentButtons').hide();return true;}else{return false;};">
<input type="hidden" name="view" value="<?php echo $view ?>"/>
<input type="hidden" name="tab" value="<?php echo $tab ?>"/>
<input type="hidden" name="action" value="monitor"/>
@ -1011,7 +1011,7 @@ if ( $monitor->Type() == 'Local' ) {
</tbody>
</table>
<div id="contentButtons">
<button type="submit" value="Save" onclick="$j('#contentButtons').hide();"<?php echo canEdit('Monitors') ? '' : ' disabled="disabled"' ?>><?php echo translate('Save') ?></button>
<button type="submit" value="Save"<?php echo canEdit('Monitors') ? '' : ' disabled="disabled"' ?>><?php echo translate('Save') ?></button>
<button onclick="closeWindow()"><?php echo translate('Cancel') ?></button>
</div>
</form>