Forums

Thanks Message scroll and Returning focus to the ReCaptcha

Mino 04 Jan, 2014
Hi,
I state that I am not a programmer😶 🙂
how can I get the two together?

window.addEvent('domready', function() {
  var error = $$('#recaptcha_container_div div.error-message')[0];
  if ( error.get('html') !== '' ) {
    $('recaptcha_response_field').focus();
  }
});


and

window.addEvent('domready', function() {
  $('form_thanks_message').scrollIntoView();
});


I tried

window.addEvent('domready', function() {
  var error = $$('#recaptcha_container_div div.error-message')[0];
  if ( error.get('html') !== '' ) {
    $('recaptcha_response_field').focus();
  }
  else{
  $('form_thanks_message').scrollIntoView();
  }
});


but does not work
Mino 05 Jan, 2014
Hi forgive me,
I have explained myself badly,
my english is bad.

Both work but only individually,
I would like to combine the two scripts.

If I put them together as they are
"Thanks Message scroll" does not work.
GreyHead 07 Jan, 2014
Hi Mino.

I don't understand what you are trying to do here? You can't focus on two different things unless they are close together when either one will do.

Bob
Mino 08 Jan, 2014
Hi Bob,

Can be used together these two scripts?

I would check both when the user wrong the captcha both when he has to see the message of thanks put in the bottom of the page.

I hope I was more clear🙂
GreyHead 09 Jan, 2014
HI Mino,

No that isn't clear at all :-(

Bob
Mino 09 Jan, 2014
I would like to control the scrolling of the page, both on "recaptcha" both on "thanks message" after sending.

The two scripts allow it individually, I can not get them to work together.

Still unclear? 🙂
GreyHead 11 Jan, 2014
Hi Mino,

Well the ReCaptcha error message code needs to be in a Load JS action in the form On Load event as it is used when the form reloads.

And the Thank You page message code needs to be in a Load JS action in the form On Submit event as it is used after the form is submitted.

Bob
Mino 13 Jan, 2014
Hi Bob,

does not work 😟 😟 😟
GreyHead 16 Jan, 2014
Hi Mino,

What exactly doesn't work?

Bob
Mino 17 Jan, 2014
Hi Bob,

scrolling works only thanks message, no scrolling ReCaptcha.

I sent you a pm.

Mino
Mino 25 Jan, 2014
Hi Bob,

you read my pm
you've got time?
This topic is locked and no more replies can be posted.