choice filed

MaidhiliL
Tera Contributor

Hi

i need a help, how to make choice filed mandate using client scrpit.

1 ACCEPTED SOLUTION

SN_Learn
Kilo Patron
Kilo Patron

Hi @MaidhiliL ,

 

Try the below in onLoad Client script:

function onLoad() {
g_form.setMandatory('choiceFieldName', true);
}

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

View solution in original post

2 REPLIES 2

SN_Learn
Kilo Patron
Kilo Patron

Hi @MaidhiliL ,

 

Try the below in onLoad Client script:

function onLoad() {
g_form.setMandatory('choiceFieldName', true);
}

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Satishkumar B
Giga Sage
Giga Sage

Hi @MaidhiliL 

client script to make a choice field mandatory:

For `onLoad` Client Script:
function onLoad() {
g_form.setMandatory('your_choice_field', true);
}

For `onChange` Client Script:
function onChange(control, oldValue, newValue) {
if (newValue === 'some_value') { // Adjust condition as needed
g_form.setMandatory('your_choice_field', true);
} else {
g_form.setMandatory('your_choice_field', false);
}
}

———————————————-
Please consider marking my reply as Helpful👍 and/or Accept Solution☑️, if applicable. Thanks!

Replace `'your_choice_field'` with the actual field name and adjust the condition as needed.