shane07 Posted February 27, 2009 Share Posted February 27, 2009 I am using following code: disabledtype=field.getAttribute("disabled"); where 'field' is the id of the 'select' box. IE returns 'false' from the above code if the select box is not disabled but firefox returns a whitespace when disabled and null when enabled. I need to validate the select box only when the select box is enabled. I could not determine if the select box is enabled or disabled in firefox. In IE I used if(disabledtype==false) to determine if the select box is enabled or disabled but in firefox I could not determine either using the above code or if(disabledtype==null) or even if(disabledtype=='disabled') or if(disabledtype=='') What should I need to do to determine if the select box is enabled or disabled in firefox? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 27, 2009 Share Posted February 27, 2009 if(disabledtype==='disabled'){} if(disabledtype===false){} if(disabledtype===null){} if(disabledtype===''){} if you still have problems let me know Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 27, 2009 Share Posted February 27, 2009 Solution: http://www.patmullin.com/weblog/2006/04/06/getattributestyle-setattributestyle-ie-dont-mix/ Quote Link to comment Share on other sites More sharing options...
shane07 Posted February 27, 2009 Author Share Posted February 27, 2009 if(disabledtype==='disabled'){} if(disabledtype===false){} if(disabledtype===null){} if(disabledtype===''){} if you still have problems let me know Thanks a lot for your help. It worked well. I used if(disabledtype===null||disabledtype===false){} Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.