JSFiddle - React, Tailwind, and code Playground

by Shobhit Sharma

HTML

<label><strong>Select Multiple</strong>

</label>
<select name="profiles" id="accountProfiles" size="9" multiple="multiple">
    <option value="test">1</option>
    <option value="buzz">2</option>
    <option value="room">3</option>
    <option value="seo">4</option>
    <option value="beat">5</option>
</select>

JavaScript

var data = {
    profiles: {
        type: "object"
        properties: {
            ces: {
                type: "object"
                properties: {
                    defaultChannel: {
                        type: "string"
                        pattern: {}
                    } - modules: {
                        type: "array"
                        items: {
                            type: "string"
                            enum: [5]
                            0: "test"
                            1: "buzz"
                            2: "room"
                            3: "seo"
                            4: "beat" -
                        } -
                    } -
                } -
            } -
        } -
    } -
},

// Suggested code which I tried
// It pushes the array of values from select box into an array

//But I need to show output like: profiles { ces { [test, buzz, room] }}
// What possible I can do to get value in above form

var profiles = validateObject.profiles;
var obj = _.extend({}, profiles);
validateObject.profiles = obj;