3

i want to have a default value in the dropdown that isnt one of the choosable options (not: DefaultValue "2"). It should be something like the following but not for an input-field.

Input.Placeholder "Your name here" 

( i tried Placeholder in Select, but it didnt work)

Once you've opened the dropdown the default value should be listed the in grey and italic (or something like that). I've recognized i can't change the font settings within the option properties of the select menu.

Thanks

Select.select
[ ]
[ select
    [
        //DefaultValue "2"
    ]
    [
        option [ Value "1" ] [ str "1" ]
        option [ Value "2"] [ str "2" ]
        option [ Value "3"] [ str "3" ]
    ]
]
Einhorni
  • 79
  • 5

1 Answers1

5

Try

Select.select
[ ]
[ select
    [ ]
    [
        option [ Value ""; Disabled true; Selected true ] [ str "Your name here" ]
        option [ Value "1" ] [ str "1" ]
        option [ Value "2"] [ str "2" ]
        option [ Value "3"] [ str "3" ]
    ]
]
nilekirk
  • 2,353
  • 1
  • 8
  • 9
  • Thanks. That worked but I can't set the Value as a default like with: DefaultValue "2". Was "Selected true" supppose to do that? – Einhorni Jun 05 '19 at 15:01
  • 1
    I found the problem. I had to change a parameter in the model and set it as the value of the select. Thank you. – Einhorni Jun 05 '19 at 16:26