I\'m trying to detect if an html element I gave an id is visible or not without using jquery.
The context:
In the forgotten user password page,
As I was thinking about disabling the button, I'm here to write that I was wrong about my idea of solution for this problem, because it would be really costly to make it works. This way, after studying, testing some ideas and reading the ideas @gdoron and @AmeyaRote brought, I figured out that a simple solution was to hide the 'submit' button after clicking on it (the page is refreshed, the validation is checked and the button is available again after this process). So, here is the solution to solve the problem to avoid the user of clicking more than once on the submit button, for this particular case where I cannot disable it (if I disable after clicking, the form was not being submited):
The HTML
I just added the onclick attribute calling a javascript function I created to hide the button:
" />
The Javascript
function avoidDoubleSubmit() {
event_addEvent(window,'load',function(){document.ResetPasswordForm.secretAns.focus();});
document.getElementById('general_Submit.Label').style.display ='none';
}