Copy link to clipboard
Copied
Hi,
Do we have a script to adjust the width of the dropdown?
Thanks in Advance.
Copy link to clipboard
Copied
You need to use 'rect' event to adjust field size with script.
Copy link to clipboard
Copied
You need to provide more information. You say you want to adjust the width, but under what conditions? At the time a user is using the form or when you're setting it up, or something else?
Copy link to clipboard
Copied
Need to resize the dropdown width, when select the value in another drop down.
Copy link to clipboard
Copied
Use the custom validation script to detect the change on the dropdown that triggers the resizing.
Here's an example.
var oFld = this.getField("NextDropdown");
switch(event.value)
{
case "Select1":
oFld.rect = rctSelect1;
break;
case "Select2":
oFld.rect = rctSelect2;
break;
}
In this example I use 2 preset rectangle arrays. The presets are better than trying to manage resizing dynamically. To get the preset rectangle values, just resize the dropdown to be whatever you want. The use the console window to capture the current rectangle size.