Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement. Form Validation scrolling #446

Closed
cajoy opened this issue May 29, 2013 · 5 comments
Closed

Improvement. Form Validation scrolling #446

cajoy opened this issue May 29, 2013 · 5 comments

Comments

@cajoy
Copy link
Contributor

cajoy commented May 29, 2013

When I submit very long form and first/second field is not valid. The field is out of screen and error not visible.

So I propose to improve ActiveForm to scroll page to the first occurred error if any. So validation issues are visible all time.

@creocoder
Copy link
Contributor

You can use errorSummary at top of page.

@cajoy
Copy link
Contributor Author

cajoy commented May 29, 2013

I am not talking about error summary and especially at the top of the page.

I am talking about case when you are clicking at submit button at the bottom of the page and forgot to fill field what is out of visible screen area. In this case you don't see any validation errors and you don't know if you submitted successfully or not.

@creocoder
Copy link
Contributor

Yes. Now got idea. Vote to do this.

@qiangxue
Copy link
Member

Fixed.

tonydspaniard pushed a commit to tonydspaniard/yii2 that referenced this issue Jun 1, 2013
* upstream:
  Fixed build break.
  Fixes issue yiisoft#194: Added Application::catchAll.
  added missing default to getValue in boostrap tabs
  \yii\widgets\Menu improvement
  Fixes issue yiisoft#467: allow view file to be absent as long as the themed version exists.
  better auto scrolling.
  Fixes issue yiisoft#446: automatically scroll to first error.
@TimNZ
Copy link

TimNZ commented Jun 1, 2015

Line 504 of yii.activeform.js has an error and scrolling doesn't work:

$(window).height => $(window).height()

                if (top < wtop || top > wtop + $(window).height) {
                    $(window).scrollTop(top);
                }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants