devxlogo

Use VBScript Split Function with Multi-Select Controls

Use VBScript Split Function with Multi-Select Controls

When you have a multi-select control, your request variable for the control will be comma delimited. An easy way to retrieve each option value is to use the VBScript Split function. Split basically accepts a string and a delimiter. You can also pass it a count value to tell it how many strings to split, as well as the compare type if, for example, you want the delimiter to be case sensitive. An array is returned by the split function, and we can use the handy Lbound and Ubound functions to write a loop. This way, the array can be arbitrarily large or small. This technique also works if you have a check box group or a large text field of, let

devx-admin

Share the Post: