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? Link to comment https://forums.phpfreaks.com/topic/147121-getattribute-not-working-in-firefox/ 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 Link to comment https://forums.phpfreaks.com/topic/147121-getattribute-not-working-in-firefox/#findComment-772388 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/ Link to comment https://forums.phpfreaks.com/topic/147121-getattribute-not-working-in-firefox/#findComment-772389 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){} Link to comment https://forums.phpfreaks.com/topic/147121-getattribute-not-working-in-firefox/#findComment-772416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.