Convert DropDownList to a ComboBox

It’s now easy to convert your ASP.NET DropDownList to a ComboBox using a jQuery library.

This helps your users easily find an option in your DropDownList when it contains many options.

This works if you create the options manually, or bind them to a WorkflowGen Global List.

This article uses the select2 library.

Once you launch the action, your DropDownList will have a search tool where you can filter down the options and select the appropriate one.

image

Step 1: Find your DropDownList ID

In this case, the ID is REQUEST_DDL.

Step 2: Go to Form Configuration > Web References

  1. Enable jQuery.

  2. Add the following code (make sure to change the code to reference your own DropDownList IDs):

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css" />
    
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js"></script>
    
    <script type="text/javascript">
    
        if (typeof $selectedObject === "undefined") {
          $(function () {
                // Change this code to refer to your dropdownlist ID
                $("[id=REQUEST_DDL]").select2();
                //$("[id=REQUEST_DDL2]").select2();
            });
        }
    
    </script>
    

It should look like this:

That’s all!