Saturday, 6 October 2012

How to Hide / Remove reCaptcha Audio ?

Are you using reCaptcha and trying to hide the audio button! Then use this javascript and css to do it simply!  Frist we would hide the button and then fill the colour in the hidden area!

To Hide the buttons

Add this javascript code anywhere after the reCaptcha code.

<script type="text/javascript">
jQuery(document).ready(function(){
 document.getElementById('recaptcha_switch_audio_btn').style.display="none";
 document.getElementById('recaptcha_reload_btn').style.display="none";
 document.getElementById('recaptcha_whatsthis_btn').style.display="none";
}); 
</script>

Filling background color in the hidden button area

Now we have a empty space in the column where the buttons are. It is because recaptcha dont use universal background and gives background to every element! So just use CSS to replace the color and merge the white blank area to the grey type background! Add this below code in <head> section on your webpage!

<style>
#recaptcha_table tr {background:#dfdfdf;}
</style>

Done!
ReCAPTCHA Hidden Audio button Preview