开发者

Highlight the jquery tab when error occured validate with jquery validation plugin

开发者 https://www.devze.com 2023-04-01 18:26 出处:网络
I have a form with 3 tabs using jquery UI/TABS. im using jquery validation plugin to val开发者_如何转开发idate the form and if my 2nd tab\'s text box hit therequiredfield error how to highlight the 2n

I have a form with 3 tabs using jquery UI/TABS. im using jquery validation plugin to val开发者_如何转开发idate the form and if my 2nd tab's text box hit the required field error how to highlight the 2nd tab then user can see the where is the error coming from

any help

regards


Just find the second tab and add some css class to it.

Given you've created tabs like this:

$("#example").tabs();

You can easily "select" any of the tabs and add some class to it to highlight it (to add class to third tab:

$("#example > ul > li:nth-child(3)").addClass('my_tab_highlight');

Of course you have to have some css to correspond with the my_tab_highlight css class, to have any visuall indication. Also, after user clicks this third tab you would probably want to remove the my_tab_highlight class.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号