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

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

Hi @Sachin Shivaku1,

 

Can you please help me with table name on which we have to write this client script

Sri Harsha3
Tera Expert

Hi,

 

In questions string field you will have the option to depends on where you need to choose the field and the values it depended on. I hope this helps.

 

 

Arindam Bose1
Kilo Contributor

Hello Harsha,

Thank you for your response.

But making the dependent filed mandatory only makes one questions mandatory. But I need to make 4 questions dependable.