Forums

The transition browser to the field with the incorrect data

Frage 10 Nov, 2012
The transition browser to the field with the incorrect data entered.

Hi!

When I press the Send button, a prompt is displayed if the field is obligatory for filling empty. If to enter incorrect data displayed the red box with the error. But! The user's browser does not move to the field with an indication of this error and often form simply is not sent.
My question.
What I should do to show the field with the wrong entered data in the browser
GreyHead 11 Nov, 2012
Hi Frage,

I think that there is a FAQ with some code to set the focus, please take a look.

Bob
Frage 11 Nov, 2012
Hello!

I could not find the correct code.
That's what I tried to use
1.
window.addEvent('domready', function() {
$('ChronoContact_formname').addEvent('submit', function() {
var messages = $$('.LV_invalid_field');
messages[0].focus();
messages[0].blur();
});
});

http://www.chronoengine.com/forums.html?cont=posts&f=2&t=21668&p=68930&hilit=set+focus#p68930
2.
window.addEvent('domready', function() {
  $('tablet_focus').focus();
});

http://www.chronoengine.com/forums.html?cont=posts&f=2&t=81505&p=289790&hilit=set+focus#p289790

С уважением Frage
GreyHead 11 Nov, 2012
Hi Frage,

I can't test from here to work out the correct code. The first example that you have is for the previous version of ChronoForms, the second assumes you already know the input you want to focus on.

I'm travelling home in a few hours and will take a look when I'm back in the office.

Bob
Frage 11 Nov, 2012
Thank you.
GreyHead 13 Nov, 2012
Hi Frage,

Please see this FAQ about setting client-side validation options. There is a FormCheck option keepFocusOnError that I think does what you need. The code would look like:
display: {
  keepFocusOnError: 1
},

Bob
Frage 13 Nov, 2012
Hi, Bob! Thank you for participating.
I downloaded and installed CFv4 Show HTML [GH] action, but I can not find the tab Hi, FormCheck...looked everywhere.
GreyHead 13 Nov, 2012
Hi Frage,

It should be like this:
[attachment=0]13-11-2012 18-10-09.png[/attachment]

Bob
Frage 13 Nov, 2012
Sorry. Here are all of the tabs.
[attachment=2]001.png[/attachment]
[attachment=1]Form Wizard Mode - Advanced (Default).png[/attachment]
[attachment=0]Form Wizard Mode - Easy.png[/attachment]
GreyHead 13 Nov, 2012
Hi Frage,

In the Advanced Wizard click the Events Tab, then the Configuration icon on the Show HTML [GH] action.

Bob
Frage 13 Nov, 2012
Hi Bob!

All done. Nothing has changed. : (

[attachment=0]002.png[/attachment]
[attachment=1]001.png[/attachment]

Sincerely Basil.
GreyHead 13 Nov, 2012
Hi Frage,

Well no, that's serverside validation - the Check Captcha - not client side. I've obviously lost track of what your question is???

Bob
Frage 14 Nov, 2012
If CAPTCHA is filled incorrectly, the browser does not focus on it. Focusing the browser should be on the field with the error (displayed in a CAPTCHA).
Green - page site.
Orange area - the user's screen. If an error is generated user does not see it.
[attachment=0]000.png[/attachment]

Frage.
GreyHead 15 Nov, 2012
Hi Frage,

I've just updated this FAQ to add a script snippet to refocus on the Captcha box.

Bob
Frage 15 Nov, 2012
Hi Bob!

Cool! Wonderful! Issue has been resolved!
I have two forms of "Form1 ->Field ID = number1_id" and "Forma2 ->Field ID = number2_id"
The code is a
window.addEvent('domready', function() {
  var error = $$('#number1_id_container_div div.error-message')[0];
  if ( error.get('html') !== '' ) {
    $$('#number1_id_container_div input.chrono_captcha_input')[0].focus();
  }
});

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


PS:
And for [Show Thanks messagi] this can be done?
GreyHead 15 Nov, 2012
Hi Frage,

And for [Show Thanks messagi] this can be done?

Sorry, I'm not clear what your question is here?

Bob
Frage 15 Nov, 2012
Hi Bob!

Sorry, I need to create a new post?

Frage.
GreyHead 15 Nov, 2012
Hi Frage,

I just don't understand what you are asking?

Bob
Frage 15 Nov, 2012
Hi Bob!

Sorry. One form is not working. Boot Order forms: Form1, Forma2. Form1 works but Forma2 not. In Forme2 stopped working even tips.
I noticed that in Forma2 not added to the class attribute tag "form-error":
in Forme1
class = "ccms_form_element cfdiv_text label_over form-error"

in Forme2
class = "ccms_form_element cfdiv_text label_over"


Here's a screenshot Forma2 (same and Form1):
[attachment=0]Screenshot Forma2.png[/attachment]

Frage
Frage 17 Nov, 2012
Please help! I am a grateful man!

Frage!
GreyHead 18 Nov, 2012
Hi Frage,

Please post a link to Forma2.

Bob
Frage 19 Nov, 2012
Hi, Bob!

pachom.jino.ru

Thank you for your attention to my situation.
GreyHead 19 Nov, 2012
Hi Frage,

You'll need to change the script to match the ids of the elements in your form. I'm not quite sure what they are here but your browser web developer tools will allow you to find them.

You may also need to edit the script to handle the tabbed forms correctly.

Bob
Frage 19 Nov, 2012
Hi, Bob.

I can not do that unfortunately. I'm not a programmer.
Nevertheless, thanks for your time.

PS: Can I buy you a beer Yandex.Money?

Frage.
Frage 20 Nov, 2012
Hi Bob!

You can be asked to write a simple and secure script to scroll down the page after clicking on the Send button? How much will it cost?

I would be very grateful.
This topic is locked and no more replies can be posted.