Possible bug with <select><option> value modification and Back button on Chrome

廉价感情. 提交于 2019-12-03 02:15:12

I was having the same issue, and came across this issue while searching Google. For anyone else stumbling across this: I fixed the issue by setting 'autocomplete="off"' on the form. Of course, this may not be desirable for all situations.

I'm running Chrome 30.0.1599.101 on OSX 10.9. The web site is built using the Wicket framework (which uses jQuery for AJAX).

I found an simple workaround by creating a hidden text and just before a submit or change set it to the selected value.

Simple jQuery workaround.

$(document).ready(function () {
    $("select").each(function () {
        $(this).val($(this).find('option[selected]').val());
    });
})
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!