Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form onsubmit="return confirm_action('Really delete?')" action="" method="post" accept-charset="utf-8">
- function confirm_action(message) {
- if(message===undefined){message='are you sure?';}
- if(confirm(message)){
- // prevents clicking the submit button more than once
- prevent_double_submit.call(this);
- return true;
- }
- else{
- return false;
- }
- }
- function prevent_double_submit(){
- $('input[type=submit]',this).attr('disabled', 'disabled');
- $('input[type=submit]',this).attr('style', 'background:url(/files/images/colorbox/loading.gif) no-repeat center');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement