why doesn't IE8 refresh textbox right away?(Jquery)
Posted
by AndrewSmith
on Stack Overflow
See other posts from Stack Overflow
or by AndrewSmith
Published on 2010-04-15T01:19:55Z
Indexed on
2010/04/15
1:23 UTC
Read the original article
Hit count: 289
jQuery
|internet-explorer-8
I have 3 radio buttons and one textbox in my page. These 3 radio controls represent corresponding choice and among them, the third one enables textbox that is disabled by default. If user clicks any one from the first twos after clicking the third, the textbox will be emptied(if user input any) and disabled again. The problem is, in IE, the textbox isn't emptied not until I click back once again on the said textbox. I've used jquery val methods as well as attr but nothing seems to work. You can see my code as follows. The very same code works just fine in Mozilla. I'm not sure why IE is having problem.
m.bind_eventform = function(){
$('input[name=poster]').change(function(){
if($('input[name=poster]:checked').val()==2) $('#poster_other').removeAttr('disabled');
else if(!($('#poster_other').is(':disabled')))
{
$('#poster_other').attr('disabled','disabled');
$('#poster_other').attr('value',''); //this one doesn't work
$('#poster_other').val(''); //as well as this one
}
});
};
$(document).ready(m.bind_eventform);
© Stack Overflow or respective owner