Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Dec 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need help for .disabled in IE

    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

    Code:
    if (output=="Available")
            document.register.submitBtn.disabled=false;
        else
            document.register.submitBtn.disabled=true;
    Last edited by xporiten; 12-29-2010 at 05:38 PM.

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,396
    Thanks
    12
    Thanked 569 Times in 562 Posts
    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)

  • #3
    New Coder
    Join Date
    Dec 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the problem in IE that stated is Object doesn't support this property or method.

    the code for whole function is
    Code:
    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;
    }

  • #4
    New Coder
    Join Date
    Dec 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    devnull89 thanks anyway..i solved it..i found a trim functionality created by others to solve IE problem..


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •