locked
Enable /disable Input tags (Textbox) and dropdowns, Checkbox ..etc in HTML RRS feed

  • Question

  • User86716463 posted

    Hi All,

    Based on the roles I need to disable/enable only set of html controls( text box, dropdowns , checkbox etc),  Parent tags is Table.

    I can have multiple tables,  based on the roles I need choose and disable/enables. 

    Please help me on this 

    Regards,

    Ramesh

    Wednesday, September 5, 2018 1:27 PM

All replies

  • User-1171043462 posted

    In HTML means?

    Are you using ASP.Net or MVC? How roles are being implemented?

    Wednesday, September 5, 2018 1:44 PM
  • User86716463 posted

    Hi Mudassrkhan,

    Its pure HTML pages and using JQuery to get data from backend.

    We are not using ASP.NET or MVC.

    Thanks,

    Ramesh

    Thursday, September 6, 2018 6:50 AM
  • User1520731567 posted

    Hi n.m.rameshraja,

    Based on the roles I need to disable/enable only set of html controls( text box, dropdowns , checkbox etc),  Parent tags is Table.

    I think you could code in Initialization function.

    To change the disabled property you should use the .prop() function.

    For example:

    $(document).ready(function () {
       if(role=="aa")
        {
          $("input").prop('disabled', true);
    ... } else { $("input").prop('disabled', false);
    ... } }

    More details,you could refer to:

    https://stackoverflow.com/questions/1414365/disable-enable-an-input-with-jquery

    Best Regards.

    Yuki Tao

    Friday, September 7, 2018 9:16 AM