Skip to content

I want to prevent input from being entered into another field depending on the user's input operation

Answer

Use "Script".


Overview

If you enter "1" in category A, the function that makes category B read-only must be implemented using a "Script". The sample code is shown below.

Operation Procedure

  1. Create a table and enable ClassA and ClassB.
  2. Create a new "Script" and enter the contents of the script below. Check "Create new" and "Edit" for the output destination to change or update.
  3. Open the record editing screen and enter '1' into ClassA.

Code Samples

JavaScript
$(document).on('change', '#' + $p.getControl('ClassA')[0].id', function () {
    if ($p.getControl('ClassA').val() === '1') {
        $p.getControl('ClassB').attr('readonly', true);
        $p.getControl('ClassB').css('background', '#f5f5f5');
    }
});