フォームを送信時、エラー箇所へ自動でジャンプする機能について、iOSだと自動でジャンプしませんがこちらの対策などあれば教えてください。
Solved! Go to Solution.
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.
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).
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.
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?
Yes, definitely on my blog but perhaps also on the Products blog. I'll post the link tomorrow.
Takeshi, I explained the details here: https://nation.marketo.com/t5/Product-Blogs/Auto-scrolling-to-the-first-validation-error-on-iOS-fixi...