I need to placeholder to be set for a field

siddharth26
Tera Guru

Am using on change client script, 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
g_form.setFieldPlaceholder('u_network_diagram','Provide the link to the current CDE diagram that reflects the changes being requested');

 

 

but its not working 

 

thanks

sid

3 REPLIES 3

reshmapatil
Tera Guru

Hi @siddharth26 ,

 

 

Before you use placeholder by client script ensure your field is present on the form. If yes then you could achieve this with an onLoad client script.

1. 

var field1 = g_form.getControl('[INSERT NAME OF FIELD HERE]');

field1.placeholder = "Test Placeholder";

or

2. 

reshmapatil_0-1671195137917.png

 

Regards,

Reshma

**Please mark my answer correct or helpful based on the impact**

Hi Reshma,

 

I have tried this but still does not work for me.

thanks

sid

Hi @siddharth26 ,

 

It's working for me:

reshmapatil_0-1671198127628.pngreshmapatil_1-1671198162538.png

Are you trying on filed/variable and which type of field it is?

If you are using to place it on variable use can use Example Text

reshmapatil_2-1671198281252.png

Also check if you have any other UI Policy/Client Script running which is clearing this field value.

 

Regards,

Reshma

**Please mark my answer correct or helpful based on the impact**