How to fix Yii2 Contact Widget Problem on View Pages

南笙酒味 提交于 2019-12-25 00:24:20

问题


I followed the example here Yii2, feedback form in a modal window and I was able to create a contact widget that I added it above the footer of multiple pages on my website using the code <?= FBFWidget::widget([]) ?>.

I stripped the code of the modal box so I am not using that. The problem I am facing now is that whenever I opened a webpage, the page jumps straight to the contact form at the footer instead of showing the top of the page as a any normal browser should do.

I followed all the code as explained in the tutorial so I do not want to post all the codes here. Please see the tutorial

How can I stop this problem.


回答1:


You are using autofocus property on the contact form field name which is forcing the page to go down as the cursor is focused inside the input field, you should remove that property or bind it only if the page url is /contact-us or whatever you are using for the contact form.



来源:https://stackoverflow.com/questions/55379105/how-to-fix-yii2-contact-widget-problem-on-view-pages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!