开发者

How can I make my jQuery-UI checkbox buttons detect the state of a checkbox on page load?

I have a table of venues and am using a filter form on the index page which contains a bunch of checkboxes allowing the user t开发者_运维知识库o filter through all the records, displaying the results as partials.

I'm using jQuery-UI to make the checkboxes look better and all is working fine except that once the form is submitted the page reloads, displays the results and clears the form. I dont want the form to clear so I tried using the dumbFormState plugin which is keeping the state of the form on page reload but jQuery isn't detecting this and the form looks like its been cleared but isn't. On degraging the jQuery the checkboxes are still checked but jQuery isn't maintaining the 'checked' style on the chechboxes on page reload.

Can anyone help me to get jQuery to realise if a checkbox is in a checked state on page load and display the correct style?

edit

I just noticed if I check some boxes, submit the form the search takes place and the form appears to be cleared but if I then refresh the page the checked style is re-applied to the checked checkboxes.

Thanks for any help its much appreciated!


The problem could be that the dumbFormState plugin runs after the jquery-ui plugin. Have you tried running dumbFormState before jquery-ui?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜