Blank value on select

I have a select for state selection. This select is populate by database value.
how can I have the null value if it is null also in the database?
Thank you @Teodor

1 Like

image

Remove the hard-coded selected value, and it will work as required.

ok, but if I remove the code, when I open the page, select shows the first record ! In this case BELGIO
I want show a blank input !
I do not want to see any value, I would like the empty select

To select a blank entry by default, you will have to add a default blank entry.
Just add a blank item using the ‘add’ icon, or add an empty <option value=""></option> in code view.
image

1 Like

Or, even better, add the empty <option> as
<option value='-1'></option
and then set the Selected Value field to -1 (no quotes). So, when you have a value in database, it will get selected, else -1, which is blank.

1 Like

ok, the first solution works great !

the second solution works very well !

1 Like

Another question @nshkrsh
I have this select but the “Tutti” value doesn’t select all records (Cliente and Fornitore)
image
How can I do ?
I want see all records when I select Tutti

I tried with % but doesn’t work

The way I did it in my app was that I set default “All/Tutti” option’s value as -1. Then, in my server action I added a condition in query builder condition tab that if parameter value is not -1, then filtered results are returned. Else, condition does not work and all data gets fetched from the query.

I hope you get it. :sweat_smile:
I don’t have access to my system right now, else would have attached an image.

when you can attach me an image, thank you !

In the condition tab of query builder, set the condition for where condition as shown above.
Here the senderid is the name of SELECT form element.
Hope this clears it up.

1 Like