After several attempts, I can not figure out how the select dropdown property works when you want to save the selected item into a table. Let’s say that I have a very simple table named Companies, with a field varchar named Province. Then I have another table called Province that lists all the Province names.
What I do is that I set up a form with a select element and I link it the a server connection that does the query in the Province table. In this way I have the select pre-populated with all the province.
There is no way to update the province name. In the same form there is also an input field to update the company name and it works perfectly. The problem comes up only with the select form.
Any help is appreciated. I have read any possible threat and watched so many video. I understand that most of you are developers and probably this is a question for very beginners but I could not find any tutorials specific on this topic. Many thanks
Hello,
On your first screenshot, in the “Selected Value” field you should bind the value returned by the database query for the current record, so if in database the “province3” is stored, then it will show “province3” selected in the dropdown.
Then your question about “Value Field” - you should first understand how a select/dropdown menu works. See the code created for a dropdown:
value is what you pass to your database on form submit, the Text is just what the users see on the page. The value usually holds IDs of the records you show in the Text.
In the update record you pass the select menu as any other input on the page … if your select menu name is myselect then your post variable will be {{$_POST.myselect}}
Is there a way to just use a list rather then populating this options table. I think I remember seeing somewhere that I can just use a list, but don’t remember the syntax. Thanks,
Apologies, I mean a static dropdown box. Is it possible to place these values in list form in the options properties section instead of manually entering into the table. ie. ‘Op1’,‘Op2’,‘Op3’ etc. I have a few static dropdown to make that have a large amount of static options.
ah perfect, I can probably locate them in the code and add quicker from there. I just thought I remembered that I was able to add them in this format to the options properties section ‘Option1’, ‘Option2’ etc.