I use the Following script for change recaptcha in asp with c# server side.But this code Didn't Work.How to change color or theme of the ReCaptcha?
<script type="text/javascript">
var RecaptchaOptions = {theme : 'White'};
</script>
I use the Following script for change recaptcha in asp with c# server side.But this code Didn't Work.How to change color or theme of the ReCaptcha?
<script type="text/javascript">
var RecaptchaOptions = {theme : 'White'};
</script>
Share
Improve this question
asked Nov 19, 2012 at 9:16
V.VV.V
8833 gold badges25 silver badges56 bronze badges
1
- 1 The theme name is 'white' not 'White' note the capital. – Ryan McDonough Commented Nov 19, 2012 at 9:22
4 Answers
Reset to default 3I think you are just writing the name of the theme in wrong way, just try White with a small 'w'.
<script type="text/javascript">
var RecaptchaOptions = {theme : 'white'};
</script>
See this link for exact working code:
https://developers.google./recaptcha/docs/customization
George Siggouroglou's second method for asp is a charm
I couldn't seem to set the theme as instructed in https://developers.google./recaptcha/docs/customization - placed the js above the form containing the recaptcha control - but adding the theme attribute directly into the recaptcha code as George explained:
<recaptcha:RecaptchaControl
ID="recaptcha"
runat="server"
PublicKey="your-public-key"
PrivateKey="your-private-key"
Theme="white"
/>
works.
U used the capital W
instead of small i.e. w
Try this
Change the theme and try
<script type="text/javascript">
var RecaptchaOptions = {
theme : 'white'
/*WE CAN USE FOLLOWING THEME TO CHANGE THE COLOR OF RECAPTHCA*/
/*red,white,blackglass,clean'*/
/*lang :'es';*/ //used to set the language
};
</script>
If you are using asp and if you are using the recapctcha for asp control, then if you want to change the theme (red(default),white,blackglass,clean) there is two ways.
Way no1,
To make the reCAPTCHA widget display a different theme, you first need to add the following
code in your main HTML page anywhere before the element where reCAPTCHA appears
(this will not work if placed after the main script where reCAPTCHA is first invoked):
<script type="text/javascript">
var RecaptchaOptions = {
theme : 'theme_name'
};
</script>
Way no2:
Add the property 'Theme' to the recapcha asp control:
<recaptcha:RecaptchaControl
ID="recaptcha"
runat="server"
PublicKey="your-public-key"
PrivateKey="your-private-key"
Theme="white"
/>