Forum Discussion

michelle's avatar
michelle
Creator II
8 years ago

Dropdown can not disable

Hi Field Type use Dropdown I want to disable this dropdown, so write a method onFormPopulated event. Method Code: var sel_imie = $('select[name="_list"]'); sel_imie.prop('disabled', true); Chrome version 63.0.3239.108 first on load  can not disable, but refresh page can disable. Try IE 11 can disable I don't know why chrome first on load can't.      

4 Replies

  • Hello, Could you please confirm which version of Aras Innovator you are using? In a local test, it seemed the dropdown had not yet loaded by the time my onFormPopulate event was called. I worked around this by using setTimeout(myFunction, 100) to call my code that disabled the dropdown. Could you try using a timeout to call your code to see if it resolves the issue you're seeing? Chris _______________________________ Christopher Gillis Aras Labs Software Engineer
  • Hi Gillis Aras Innovator Version 11.0 SP9  Build: 6549 How to use setTimeout(myFunction, 100) like this example? onFormPopulated event Code : debugger; var innovator = document.thisItem.getInnovator(); setTimeout(myFunction(), 100); function myFunction() { var sel_imie = $('select[name="_list"]'); sel_imie.prop('disabled', true); }    
  • Hi Michelle, You only need to pass in the name of the function as an argument to setTimeout. Please see the example below.
    var innovator = document.thisItem.getInnovator();
    setTimeout(myFunction, 100);
    function myFunction()
    {
    var sel_imie = $(‘select[name=”_list”]’);
    sel_imie.prop(‘disabled’, true);
    }
    Chris _________________________________ Christopher Gillis Aras Labs Software Engineer