Cześć, potrzebuję Waszej pomocy w przerobieniu prostego kodu. Jako, że z JS nigdy nie miałem styczności nie radzę sobie z tym. Chciałbym poniższy kod przerobić tak aby funkcja showRecaptcha była od razu wyświetlana a nie tak jak teraz po przyciśnięciu przycisku. Proszę o pomoc.
<script type="text/javascript" >
function showRecaptcha(element, submitButton, themeName) {
Recaptcha.create("$key_public", element, {
theme: '$recapt_thme',
lang: '$recapt_lang',
callback: Recaptcha.focus_response_field
});
hideSubmitButtons();
document.getElementById(submitButton).style.visibility = "visible";
}
function hideSubmitButtons() {
document.getElementById('submit_button_1').style.visibility = "hidden";
}
function destroyRecaptchaWidget() {
hideSubmitButtons();
Recaptcha.destroy();
}
</script>
<form method="post" action="">
<input type="button" class="comment_button" value="$lang_plugin_captcha_login_click" {$lang_login_php['login']}" onclick="showRecaptcha('dynamic_recaptcha_1', 'submit_button_1', 'red');"></input>
<div id="dynamic_recaptcha_1"></div> <input name="submitted" style="visibility: hidden" type="submit" class="button" value="{$lang_login_php['login']}" tabindex="4" id="submit_button_1" /></input> <div></div> <input type="button" class="comment_button" value="$lang_plugin_captcha_hide" onclick="destroyRecaptchaWidget();"></input>
</form>