Client Side API - Making a Field Read Only

Forgive me if I am missing something really obvious but within the Client Side API there doesn't appear to be a way of making a field read only. You can hide a field and collapse it so that it doesn't interfere with the table layout so I would expect to be able to make it read-only.

  • 0

    Normally you'd do this via the createscript by putting:

    ReadOnly = true;

    If you want to disable it clientside, then you can alter its style in the custom content:

    You can use jQuery:

    $("id").prop('disabled', true);

    Using pure javascript:

    document.getElementById(id).disabled = true;

    Are you looking to disable it based on other selected field values as the user edits fields on the page? If so, then you need a function to disable a passed field which you fired from the source fields onchange script.

  • 0

    Alison

    Adding the capability to enable/set the field to be read-only would be a pretty reasonable enhancement and this is something that you may want to raise through support as a change. But from a design point of view we would only be temporarily changing the HTML of the screen and this has some security limitations. Changes made by a create script are much more profound alterations to the HTML that is sent to the browser.

  • 0

    Should the ability to disable fields not be included within the Client Side API itself? As mentioned it is possible to achieve this server side, why not include it client side? My belief is that the client side API is there so that raw JavaScript for simple operations is not required.