Skip to main content
ReluctantProgrammer
Level 4
September 28, 2022
해결됨

How to code a field to be required

  • September 28, 2022
  • 2 답변들
  • 944 조회

I have a form which has 3 checkboxes that if checked then the corresponding text boxes becomes visible.  I also need each text box to be Required if it is visible; it should remain optional if the field remains hidden.  Is there a code for this?

 

BIP 126 

이 주제는 답변이 닫혔습니다.
최고의 답변: radzmar

You can set the mandatory property via script.

 

//Make field mandatory
textfield.mandatory = "error";

// Make field optional
textfield.mandatory = "disabled";

 

2 답변

radzmar
radzmar답변
Level 10
September 28, 2022

You can set the mandatory property via script.

 

//Make field mandatory
textfield.mandatory = "error";

// Make field optional
textfield.mandatory = "disabled";

 

ReluctantProgrammer
Level 4
September 28, 2022

Worked perfectly!

 

Thanks so much!