SOLVED

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

Go to solution
Takeshi_Oshima
Level 2

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

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

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

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

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.

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

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

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

SanfordWhiteman
Level 10 - Community Moderator

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

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
Level 2

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

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
Level 10 - Community Moderator

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

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

SanfordWhiteman
Level 10 - Community Moderator

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