Return to default value when ui policy returns false.

imran rasheed
Tera Contributor

I have yes/no type fields with in catalog and i have also set default value as none by checking the tick box.

Here i have a ui policy, where this yes/no field gets enabled when another field ("B") is chosen and user chooses yes or no.

When user selects someother value in ("B") field, this yes/no should come to default "none". How to achieve this?

Is there any return false script to be written?

9 REPLIES 9

Yes, it does not return to default. hence the script to be used. Or you can create another UI policy where you add a condition that if B value is some other than yes/no, then create a UI action and set the value to default and enable it.

Mark the comment as a correct answer and helpful if it helps.

 

Imran, did you try the above option suggested?

i am not following your requirement properly,

but if a field has default value and if the condition for reverse is true. than that field will be working as you desire to have.. seems like something else is causing the issue.

next question does filed B have choices?

I am having two fields A & B. Both A & B has drop down values Yes, No, None.  None is by default.  When A is yes, B field will be visible. Now i select Yes in B field.

Then i change my mind and select No in A field, whereas the value in B should be none. Instead it will be as Yes, as we selected before.

You can do this in UI policy script or on change client script.

example

if (newValue == 'A' || newValue == 'B')
{
g_form.setValue('field name', '');