Magento 1.9 : Validate the Google reCaptcha in custom popupHow to make google reCaptcha mandatory on...
Is there any risk in sharing info about technologies and products we use with a supplier?
Why was Lupin comfortable with saying Voldemort's name?
Using only 1s, make 29 with the minimum number of digits
Why am I able to open Wireshark in macOS without root privileges?
Early credit roll before the end of the film
Do authors have to be politically correct in article-writing?
Numbers with a minus sign in a matrix not aligned with the numbers without minus sign
How should I handle players who ignore the session zero agreement?
What would the chemical name be for C13H8Cl3NO
What is a good reason for every spaceship to carry a weapon on board?
Why is it that Bernie Sanders is always called a "socialist"?
Use two 8s and two 3s to make the number 24
Mathematics and the art of linearizing the circle
Play Zip, Zap, Zop
Is it possible to grant users sftp access without shell access? If yes, how is it implemented?
Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act (2019 S.130)?
Quickly creating a sparse array
When can a QA tester start his job?
Positioning node within rectangle Tikz
What's a good word to describe a public place that looks like it wouldn't be rough?
Why would space fleets be aligned?
Why exactly do action photographers need high fps burst cameras?
Consequences of lack of rigour
A curious equality of integrals involving the prime counting function?
Magento 1.9 : Validate the Google reCaptcha in custom popup
How to make google reCaptcha mandatory on contactus pageGoogle Recaptcha Issue on Showing the in Product ReviewHow to Validate the Google reCaptchaGoogle Invisible reCaptcha : bad redirection with AjaxMagento 1.9 : Google reCAPTCHA not letting me create an accountHow to integrate reCAPTCHA v3 in magento 1.9?Installing Google recaptcha:2.0.0 on Magento Open Source 2.2.xIs any way to use Google Invisible reCaptcha in Magento 1.9 admin login?Google recaptcha v2 on Magento 1.9
I have added the google recaptcha in custom popup. But, form is also submitting without captcha.
I have used following codes for captcha:
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
I have also used js code for validating. But, I think it's not proper way to validate it.
=> js code :
function checkcaptcha() {
if((jQuery('#g-recaptcha-response').val())=='') {
jQuery('.captcha-error').css('display','block');
return false;
} else {
jQuery('.captcha-error').css('display','none');
}
}
Please help me for validating reCaptcha in proper way.
Thanks.
Note : Do not suggest any extension link here. I want to check programmatically.
magento-1.9 captcha
bumped to the homepage by Community♦ 8 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have added the google recaptcha in custom popup. But, form is also submitting without captcha.
I have used following codes for captcha:
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
I have also used js code for validating. But, I think it's not proper way to validate it.
=> js code :
function checkcaptcha() {
if((jQuery('#g-recaptcha-response').val())=='') {
jQuery('.captcha-error').css('display','block');
return false;
} else {
jQuery('.captcha-error').css('display','none');
}
}
Please help me for validating reCaptcha in proper way.
Thanks.
Note : Do not suggest any extension link here. I want to check programmatically.
magento-1.9 captcha
bumped to the homepage by Community♦ 8 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have added the google recaptcha in custom popup. But, form is also submitting without captcha.
I have used following codes for captcha:
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
I have also used js code for validating. But, I think it's not proper way to validate it.
=> js code :
function checkcaptcha() {
if((jQuery('#g-recaptcha-response').val())=='') {
jQuery('.captcha-error').css('display','block');
return false;
} else {
jQuery('.captcha-error').css('display','none');
}
}
Please help me for validating reCaptcha in proper way.
Thanks.
Note : Do not suggest any extension link here. I want to check programmatically.
magento-1.9 captcha
I have added the google recaptcha in custom popup. But, form is also submitting without captcha.
I have used following codes for captcha:
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
I have also used js code for validating. But, I think it's not proper way to validate it.
=> js code :
function checkcaptcha() {
if((jQuery('#g-recaptcha-response').val())=='') {
jQuery('.captcha-error').css('display','block');
return false;
} else {
jQuery('.captcha-error').css('display','none');
}
}
Please help me for validating reCaptcha in proper way.
Thanks.
Note : Do not suggest any extension link here. I want to check programmatically.
magento-1.9 captcha
magento-1.9 captcha
edited May 16 '18 at 5:58
Rohan Hapani
asked May 16 '18 at 5:46
Rohan HapaniRohan Hapani
1
1
bumped to the homepage by Community♦ 8 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 8 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I think you have to try with using google recaptcha div class instead of id in jquery to getting google recaptcha response. I have tried below code and it's working for me:-
<div class="news-captcha">
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
</div>
JS CODE:-
var googleResponse = jQuery('.news-captcha .g-recaptcha-response').val();
if (googleResponse!= ""){
return true;
}
else {
return false;
}
After getting response you have to pass this response in input "hidden" field. In the form submit action controller function you can use this hidden field post value and check there that recaptcha response getting or empty response.
add a comment |
Please Try with below code :
<form>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
<input type="button" name="submit" value="Sub" onclick="checkcaptcha();">
<div id="captcha-error"><span></span></div>
</form>
<script type="text/javascript">
function checkcaptcha() {
var googleResponse = jQuery('.g-recaptcha-response').val();
if(googleResponse !='') {
jQuery("#captcha-error span").text("Your text here");
jQuery('.captcha-error').css('display','block');
return false;
}
}
</script>
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f226169%2fmagento-1-9-validate-the-google-recaptcha-in-custom-popup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think you have to try with using google recaptcha div class instead of id in jquery to getting google recaptcha response. I have tried below code and it's working for me:-
<div class="news-captcha">
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
</div>
JS CODE:-
var googleResponse = jQuery('.news-captcha .g-recaptcha-response').val();
if (googleResponse!= ""){
return true;
}
else {
return false;
}
After getting response you have to pass this response in input "hidden" field. In the form submit action controller function you can use this hidden field post value and check there that recaptcha response getting or empty response.
add a comment |
I think you have to try with using google recaptcha div class instead of id in jquery to getting google recaptcha response. I have tried below code and it's working for me:-
<div class="news-captcha">
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
</div>
JS CODE:-
var googleResponse = jQuery('.news-captcha .g-recaptcha-response').val();
if (googleResponse!= ""){
return true;
}
else {
return false;
}
After getting response you have to pass this response in input "hidden" field. In the form submit action controller function you can use this hidden field post value and check there that recaptcha response getting or empty response.
add a comment |
I think you have to try with using google recaptcha div class instead of id in jquery to getting google recaptcha response. I have tried below code and it's working for me:-
<div class="news-captcha">
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
</div>
JS CODE:-
var googleResponse = jQuery('.news-captcha .g-recaptcha-response').val();
if (googleResponse!= ""){
return true;
}
else {
return false;
}
After getting response you have to pass this response in input "hidden" field. In the form submit action controller function you can use this hidden field post value and check there that recaptcha response getting or empty response.
I think you have to try with using google recaptcha div class instead of id in jquery to getting google recaptcha response. I have tried below code and it's working for me:-
<div class="news-captcha">
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
</div>
JS CODE:-
var googleResponse = jQuery('.news-captcha .g-recaptcha-response').val();
if (googleResponse!= ""){
return true;
}
else {
return false;
}
After getting response you have to pass this response in input "hidden" field. In the form submit action controller function you can use this hidden field post value and check there that recaptcha response getting or empty response.
edited May 16 '18 at 9:43
answered May 16 '18 at 9:22
RajRaj
311112
311112
add a comment |
add a comment |
Please Try with below code :
<form>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
<input type="button" name="submit" value="Sub" onclick="checkcaptcha();">
<div id="captcha-error"><span></span></div>
</form>
<script type="text/javascript">
function checkcaptcha() {
var googleResponse = jQuery('.g-recaptcha-response').val();
if(googleResponse !='') {
jQuery("#captcha-error span").text("Your text here");
jQuery('.captcha-error').css('display','block');
return false;
}
}
</script>
add a comment |
Please Try with below code :
<form>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
<input type="button" name="submit" value="Sub" onclick="checkcaptcha();">
<div id="captcha-error"><span></span></div>
</form>
<script type="text/javascript">
function checkcaptcha() {
var googleResponse = jQuery('.g-recaptcha-response').val();
if(googleResponse !='') {
jQuery("#captcha-error span").text("Your text here");
jQuery('.captcha-error').css('display','block');
return false;
}
}
</script>
add a comment |
Please Try with below code :
<form>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
<input type="button" name="submit" value="Sub" onclick="checkcaptcha();">
<div id="captcha-error"><span></span></div>
</form>
<script type="text/javascript">
function checkcaptcha() {
var googleResponse = jQuery('.g-recaptcha-response').val();
if(googleResponse !='') {
jQuery("#captcha-error span").text("Your text here");
jQuery('.captcha-error').css('display','block');
return false;
}
}
</script>
Please Try with below code :
<form>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="XXXXXXXXXX"></div>
<input type="button" name="submit" value="Sub" onclick="checkcaptcha();">
<div id="captcha-error"><span></span></div>
</form>
<script type="text/javascript">
function checkcaptcha() {
var googleResponse = jQuery('.g-recaptcha-response').val();
if(googleResponse !='') {
jQuery("#captcha-error span").text("Your text here");
jQuery('.captcha-error').css('display','block');
return false;
}
}
</script>
answered May 16 '18 at 13:28
Ravi OzaRavi Oza
1388
1388
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f226169%2fmagento-1-9-validate-the-google-recaptcha-in-custom-popup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown