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

Submit驗證完後,focus會從第二個欄位開始 #258

Open
st9407 opened this issue Nov 3, 2016 · 3 comments
Open

Submit驗證完後,focus會從第二個欄位開始 #258

st9407 opened this issue Nov 3, 2016 · 3 comments
Labels

Comments

@st9407
Copy link

st9407 commented Nov 3, 2016

您好^^
我有一個表單
第一個欄位是驗證中文姓名,第二個是身分證,第三個是英文姓名
都不輸入資料,按submit後
focus會在身分證欄位而不是中文姓名

我有在angular-validation.js做測試
checkValidation函式裡面,console.log(element.attr('id'))是從中文姓名開始
但進入invalidFunc函是,console的id身分證就變成是第一個了

我也有測試您的DEMO網頁,在Form ($submit-only)不輸入資料按Submit
一樣是focus在第二個欄位Email

再麻煩您幫忙測試看看該如何修正這個問題
這個程式非常棒,很感謝您,希望能夠看到它變得更完善^^

@st9407
Copy link
Author

st9407 commented Nov 3, 2016

補充一下:
剛剛測試發現只會focus在rule是正規表達式的欄位,
錯誤訊息也是正規表達式的欄位會先提示

@hueitan
Copy link
Owner

hueitan commented Nov 3, 2016

發現只會focus在rule是正規表達式的欄位

😭 這個問題之前曾經發生過!怎麼又回來了!

感謝你的 Issue!

@hueitan hueitan added the bug label Nov 3, 2016
@ning5280
Copy link

是不是跟验证顺序有关,。。我自定义的两个验证 调换一下顺序就会出现你的问题 第一个验证是不能为空 第二个是必须是11位数字手机号(正则写的)

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

No branches or pull requests

3 participants