Prefixing the field value is not working on changing the same filed value

msc
Tera Contributor

Hi All,

I have a requirement that I need to prefix keyword in one of single line text field when some particular conditions are met in catalog item.

For this I have created a uipolicy and used runscript to set that field value.

When changing the same field value , enter new value  then prefix is not working.

For example , I have project title field if I enter some value like test then tab out then project title field value should be Demo Test. When particular conditions are met

Now I am changing the same project title field value like testing, now it should be display Demo Testing but it's not

Please share me your suggestion how can I clear this defect

 

2 REPLIES 2

piyushsain
Tera Guru
Tera Guru

Please share the script you are using, please also check the condition in UI Policy , check what should be the script if the UI Policy is checked to Reverse if False. I would suggest to use Client script instead of UI Policy script

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

Vaibhav127
Tera Guru

Hi msc,

 

Try by writing an onChange client script on the text field and the field where you are checking for the condition.

Then set the value of your text field something like this,

g_form.setValue('filed_name', 'prefix '+g_form.getValue('field_name'));