フォームのエラーへのジャンプについて | Community
Skip to main content
Takeshi_Oshima
New Participant
May 15, 2020
Solved

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

  • May 15, 2020
  • 2 replies
  • 2965 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

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.

2 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 18, 2020

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.

Takeshi_Oshima
New Participant
May 21, 2020

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?

SanfordWhiteman
New Participant
May 21, 2020

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

SanfordWhiteman
New Participant
May 18, 2020

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).