Skip to main content
답변 4개
  1. 2024년 2월 28일 오후 12:43

    @Rohit Arora (N/A) 

    To achieve in using validation rules:

     Set the criteria to fire when the checkbox is unchecked (FALSE) and the text field is changed. The formula might look like this: 

    AND(

    NOT(Checkbox_Field__c),

    ISCHANGED(Text_Field__c)

    )

    Using Lightning Web Components

    handleChange(event) {

    // This correctly captures whether the checkbox is checked or not.

    this.isTextFieldEditable = event.target.checked;

    }

    exampel:

    <lightning-input type="checkbox" label="Enable Editing" onchange={handleChange}></lightning-input>

    <!-- Use the `not` operator (!) to inverse the boolean value for the `disabled` attribute -->

    <lightning-input type="text" label="Editable Text Field" disabled={!(isTextFieldEditable)}></lightning-input>

    check below article:

0/9000