aligajani
6 months ago
982
12
Nova

How can I have a Select in Nova that lets me store JSON in the database?

Posted 6 months ago by aligajani

Sorry for the mouthful question, but in my signup page, I have something like this below. When a user selects any of the item from the options below, it gets stored in my database as a JSON value so say I select the 3rd option, it will show up as { name: 'Linkedin' } in my database.

I can technically have more keys inside { name: 'Linkedin' } and it will store that as well, while keeping the name for visibility purposes on the select itself. Is there anything like this possible in Nova, by default?

<SelectInput
                    v-model="form.reference"
                    rules="required"
                    label="How did you hear about us?"
                    :data="[
                        { name: 'Google' },
                        { name: 'Press' },
                        { name: 'Linkedin' },
                        { name: 'Facebook' },
                        { name: 'Twitter' },
                        { name: 'Advert' },
                        { name: 'Paradigm' },
                        { name: 'Referral' },
                        { name: 'Shares Magazine' },
                        { name: 'British Investor Summit' }
                    ]"
                />

Please sign in or create an account to participate in this conversation.