フォームのエラーへのジャンプについて | Community
Skip to main content
Takeshi_Oshima
Level 2
May 15, 2020 5:28 AM UTC
Solved

フォームのエラーへのジャンプについて

フォームを送信時、エラー箇所へ自動でジャンプする機能について、iOSだと自動でジャンプしませんがこちらの対策などあれば教えてください。

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
May 18, 2020 10:36 PM UTC

Hi Takeshi,

 

You can add this JS code to your page:

 

if (/iPad|iPhone|iPod/.test(navigator.platform)) { MktoForms2.whenReady(function (form) { var formEl = form.getFormElem()[0]; formEl.addEventListener("focus",function(e){ e.target.scrollIntoView(); }, true) }); }

 

 

I'll also be explaining it further in an upcoming blog post.

5 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
May 18, 2020 10:36 PM UTC

Hi Takeshi,

 

You can add this JS code to your page:

 

if (/iPad|iPhone|iPod/.test(navigator.platform)) { MktoForms2.whenReady(function (form) { var formEl = form.getFormElem()[0]; formEl.addEventListener("focus",function(e){ e.target.scrollIntoView(); }, true) }); }

 

 

I'll also be explaining it further in an upcoming blog post.

Translate
Takeshi_Oshima
Level 2
May 21, 2020 5:01 AM UTC

Thank you for your reply My question.

Also, thank you for giving me the code!

If you have any questions using this code, I will ask you again.

 

Anyway, will the blog post on your blog?

Translate
SanfordWhiteman
Level 10
May 21, 2020 5:57 AM UTC

Yes, definitely on my blog but perhaps also on the Products blog. I'll post the link tomorrow.

Translate
SanfordWhiteman
Level 10
May 18, 2020 4:05 AM UTC

I understand (through automated translation) the bug you're reporting.

 

Will post a partial solution in the next couple of days, although in testing so far there iOS Safari places barriers to a full solution (namely, we can always scroll to the first error but not always focus it).

Translate