I have two dropdowns and a text input. Textinput will display the value based on the selection of dropdown2 and the dropdown2' values will be populated based on the selection in dropdown1. I have set it all up sucessfully.
Now, what I want is that both dropdowns and textinput show default value. I cannot hard code it as this has to come from the database. User will feed data and that will be saved in our database and one of the data that the user wants to make default needs to be displayed on page load for that particular user.
I do not know how exactly this is done. But, to achieve it I think, I will create a database called 'DefaultData' this will link to the other database and fetch data. But, I do know know how can this be done. Can you help me?
Thank you.
You can simply set the default in the dropdown settings itself if you were using a default value that could be added.
However as you are using a dataset, you would need to have the dropdown value preset by the dataset value instead.
https://www.wix.com/corvid/forum/community-discussion/populate-dropdown-field-and-pre-select-one-option-for-the-user
https://www.wix.com/corvid/reference/$w.Dropdown.html#options
See the link in the related posts box on this forum post.
https://www.wix.com/corvid/forum/community-discussion/dropdown-populated-from-dataset-and-values-disappear-after-selection
Also, see other previous forum posts like these here.
https://www.wix.com/corvid/forum/community-discussion/reload-page-with-new-dataset-value-after-dropdown-onchange
https://www.wix.com/corvid/forum/community-discussion/dropdown-and-database
If you want the user to select a dropdown choice and then the dropdown to remember that choice and keep that value, then have a look at this recent forum post here.
https://www.wix.com/corvid/forum/community-discussion/back-button-that-remembers-previous-dropdown-input