dimanche 6 octobre 2019

How to prevent user to change javascript button disable() function?

Creating a forum on localhost. When user clicks on the button to post the question, my javascript function disables it(when the question was asked) to prevent question spamming. Everything okay with that, but:

Here is the code which is in /scripts/scriptname.js

    function disable() {
   document.getElementById("submit-img").disabled = true;
  }
 disable();

If the user changes this code above to false, the user can post various questions, because he can change it to: .disabled = false




Aucun commentaire:

Enregistrer un commentaire