For Example if we use page
or some others, we have that code after Submit button
<button id='req_pass' class='codo_btn codo_btn_primary'>{_t('E-mail reset token')}</button>
<img id="codo_sending_mail" style="display: none" src="{$smarty.const.CURR_THEME}img/ajax-loader.gif" />
So the goal is to add "codo_sending_mail" for Register page, because waiting on this page takes the maximum time.
What I do?
First add the code after Submit button
<img id="codo_sending_mail" style="display: none" src="{$smarty.const.CURR_THEME}img/ajax-loader.gif" />
to ....\sites\default\themes\default\templates\user\register.tpl
Then edit some code to ....\sites\default\assets\js\user\register.js
$('#codo_register').on('click', function() {
if (error_exists(register.errors)) {
$('#reg_username').focus();
return false;
} else {
$('#codo_sending_mail').show();
$(this).submit();
}
});
But the logic is not what we need, as loading button appears on first click at Submit button.
So return to page ...\sites\default\themes\default\templates\user\register.tpl
and add this code to each Input
onclick="$('#codo_sending_mail').hide();"
I do not like this solution, you understand why, help to implement this function beautifully. Thanks