Encyclopaedia Metallum: The Metal Archives

Message board

* FAQ    * Register   * Login 



Reply to topic
Author Message Previous topic | Next topic
Kennermahn
Metalhead

Joined: Fri Jan 04, 2019 1:36 am
Posts: 616
PostPosted: Fri Apr 30, 2021 6:55 pm 
 

Greetings
To avoid releases being added twice, I think it would be good idea to add a little JavaScript to prevent double submissions when clicking the Save button. I've noticed that this website uses very little JavaScript, but I guess this would justify adding some. Here's some code I found, which I've tested successfully:

Code:
var form = document.getElementById('ADD_RELEASE_FORM_ID');
var submitButton = document.getElementById('SAVE_BUTTON_ID');

form.addEventListener('submit', function() {

   // Disable the submit button
   submitButton.setAttribute('disabled', 'disabled');
         
}, false);


I hope I don't sound patronizing by including this code, I just want to help.

Thanks

Top
 Profile  
Display posts from previous:  Sort by  
Reply to topic


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

 
Jump to:  

Back to the Encyclopaedia Metallum


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group