locked
How to disable combobox-dropdown others value if select one? RRS feed

  • Question

  • hello!

    I have some issues to disable with jquery,  I tried to mange combobox-dropdown list values to disable if one of them  selected, may be  the issue in list view, because i'm trying to do it on list datasheetview, here is my code isn't work.


    <script type='text/javascript'>
    $(document).ready(function () {
    if(location.href.indexOf('http://domain/subsite/mycustomlist/Forms/view1.aspx#InplviewHashf40f5070-b033-423d-8ab4-bdb364f27893=ShowInGrid%3DTrue') != -1)
    {
    $(document).ready(function() {    
        // add change handler 
        $("input[title='Approved']").change(function()     
        { 
            MasterSelectChange();     
        }); 

        // call the change function to set up form for first display: 
        MasterSelectChange();     
    });

    function MasterSelectChange()    
    {    
        var thisVal =  $("input[title='Approved']").val();      
        if(thisVal == "Disagree")     
        {     
            $("select[title='Approved']").closest("tr").hide
        } 
        else 
        { 
           $("select[title='Approved']").show();      
        }     
    }
    </script>  
    Thursday, March 13, 2014 1:56 PM