开发者

Cached hidden input value is being used in IE9 instead of updated value

开发者 https://www.devze.com 2023-03-26 16:41 出处:网络
I have an issue with IE9 using the initial value of my hidden input element instead of the dynamically updated value.

I have an issue with IE9 using the initial value of my hidden input element instead of the dynamically updated value.

I have created the following so that you can see my issue live: http://jsfiddle.net/NN8gM/

  • The page loads, and the hidden input value is displayed. When the value is updated dynamically (by clicking the checkbox in the example), the initial value (6.00) is still being displayed in IE instead of the new value (7.00)!

The updated value is being displayed correctly in other browsers i have tried开发者_StackOverflow. Run the example in firefox to see the desired effect.

Why?


I just checked your code in ie9, one thing i would like to tell you, its not true that its picking the cached value,

actually this code is not working $(this).next().attr('value', '7.00');

i replaced that part of your code with $('input[type=hidden]').attr('value', '7.00'); and it worked fine, below is a demo.

I am still figuring out why the code you have written works in mozilla not in ie9. (actaully its very tough to debug in ie9, it almost doesnt even open)

http://jsfiddle.net/NN8gM/9/


I'd suggest doing it the normal way and using:

$('#si').attr('value', '7.00');
0

精彩评论

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