How to make comments field Mandatory when survey questions are answered. ?

Arindam Bose1
Kilo Contributor

The Survey is configured and there are some questions on it. It has a numeric scale with each questions.(radio button) If user selects ( 1 or 2 ) very poor, the comments box will become mandatory. For other values (3,4,5,6) it will be optional to fill.

Can anyone help me with this ?

 

1 ACCEPTED SOLUTION

Sachin Shivaku1
Giga Guru

Hello Arindam,

You can write a OnChange client script.

For Example:

if( g_for.getValue('field_name') == 'value' || g_for.getValue('field_name') == 'value1'){

g_form.setMandatory('comments',true);

}

Let me know if this what you were looking for.

Regards,

Sachin

View solution in original post

6 REPLIES 6

shaily bansal
Tera Contributor

we want for some option it should be mandatory and for some it should be visible but not mandatory when I am choosing the depends on field and choose the option. I am getting visibility with mandatory for that field only not for others I am not able to see

client script solution is good but i am not getting option on the form to write the script can anybody help?

By doing right click on the header u'll find the following option to write client script to make ur field mandatory.