Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How to code a field to be required

Avatar

Level 4

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 

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can set the mandatory property via script.

 

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

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

 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

You can set the mandatory property via script.

 

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

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