...

View Full Version : Resolved need help for .disabled in IE



xporiten
12-29-2010, 09:06 AM
hi, my problem is that .disabled only work in Firefox.
How do i make it work in other browses?
Below is the code i attached


if (output=="Available")
document.register.submitBtn.disabled=false;
else
document.register.submitBtn.disabled=true;

devnull69
12-29-2010, 10:01 AM
I've set up some test code for "disabled=true" here:
http://jsbin.com/avoru4
and it works perfectly well in FF, IE, Chrome and Safari iOS (did not test Opera though).

So there must be something wrong with your code.
1. Check the comparison. Are you sure the variable contains exactly what you want to compare? Sometimes you need to trim the variable content
2. Check the name and id tags to see if they are correct. Maybe choose to select the elements using getElementById or getElementsByName or similar instead of DOM object chaining (which is not always working properly)

xporiten
12-29-2010, 05:41 PM
the problem in IE that stated is Object doesn't support this property or method.

the code for whole function is

function isValidID(output){
output=output.substr(0, 10).trim();//due to bug in firefox

if (output=="Available")
document.register.submitBtn.disabled=true;
else
document.register.submitBtn.disabled=false;
}

xporiten
12-29-2010, 06:36 PM
devnull89 thanks anyway..i solved it..i found a trim functionality created by others to solve IE problem..



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum