How to increase text field width?

Wirasat
Tera Guru

I have a text field of string type. I am trying to increase its width to 300px using onLoad client script. But, its not working. I tried it in field style option as well but didn't work either.

g_form.getControl('email_address').style.width = '300px';

However, other properties in the same script works fine .

g_form.getControl('email_address').style.backgroundColor = 'yellow';
g_form.getControl('email_address').style.color = 'blue';

1 ACCEPTED SOLUTION

RatneshTSN
Giga Guru

Hi Wirasat,

 

You can try with field style; its working for me. See the screenshot below

For this you need to configure style against this field in field style

Type Field style in application navigator; configure against your table-field.  Let me know if it still does not work and if it works mark this as helpful. 

e.g. like this.

find_real_file.png

find_real_file.png

 

View solution in original post

10 REPLIES 10

No. I am working on a custom table client script.

Hi,

I have tried this and it's working perfectly fine.

g_form.getControl('email_address').style["max-width"]='300px';

 

Mark the answer correct and helpful.

 

Thanks.

I tried that and it still not working for me. All other properties works fine. For some reason, width is not setting up.

 

function onLoad() {

g_form.getControl('email_address').style["max-width"]='600px';
g_form.getControl('email_address').style.backgroundColor = 'yellow';
g_form.getControl('email_address').style.height = '150px';
g_form.getControl('email_address').style.color = 'blue';

}

Hi,

To reproduce your issue, I have tried in my demo instance and what I found is when you will put your field in left /right side panel it will not increase the field width. Give it some space. 

Like in my case, I have tried to increase the email address width, when it is just after the viptesting field and it did not change. But when I changed the email address field's place,  it increased with whatever the width size I gave. See the screenshot below, I put is after the short description field.

Can you please try this in your instance as well.  Hope this will help you out.

Mark the answer correct and helpful.

find_real_file.png

RatneshTSN
Giga Guru

Hi Wirasat,

 

You can try with field style; its working for me. See the screenshot below

For this you need to configure style against this field in field style

Type Field style in application navigator; configure against your table-field.  Let me know if it still does not work and if it works mark this as helpful. 

e.g. like this.

find_real_file.png

find_real_file.png