reloads options of the item (combo, select, multiselect only)

void reloadOptions(string name,string|array data);


namestringthe name of an item
datastring|arrayan array of options or the URL of the script retrieving the options


var formData = [
    {type: "multiselect", name: "crud_right", label: "Can create/edit/delete users:", options:[
        {text: "Administrators", value: "Option 1", selected: true},
        {text: "Power users", value: "Option 2", selected: true},
        {text: "All users", value: "Option 5"}
myForm.reloadOptions("crud_right", [
    {text: "Registered users", value: "Option 1", selected: true},
    {text: "Guests", value: "Option 2", selected: true}
// or with connector
var formData = [
    {type: "combo", name: "colors", label: "Select color:", connector: "php/colors.php?id=1"}
myForm.reloadOptions("colors", "php/colors.php?id=2"); // see XML formats below


XML format

<!-- xml format for combo -->
    <option value="value_a">text</option>
    <option value="value_b" selected="true">new text</option>
<!-- xml format for select -->
    <item value="value_a" label="text"/>
    <item value="value_b" label="new text" selected="true"/>
Back to top