Michal Krasny
Michal Krasny

Reputation: 5916

Alloy UI editable select tag

Is there any way, how user can input his own value to the aui:select component? I want the user to select an option from the drop-down list or add his own option.

Example:

<aui:select name="city" label="What city do you prefer?" id="selectedCity">
    <aui:option value="Moskau" label="Moskau" />
    <aui:option value="New York" label="New York"/>
    <aui:option value="London" label="London"/>
    <aui:option value="Berlin" label="Berlin" />
</aui:select>

This select creates a dropdown list with 4 cities, but I want to enable user to put there his own city.

Upvotes: 0

Views: 215

Answers (1)

Ranjitsinh
Ranjitsinh

Reputation: 1349

You can not input data in select component instead try adding one another option with value other. Also try getting cities dynamically rather than static. If user selects other than you can open a text box and ask user to input his/her city and than enter that city in database so that it can be used other time.

Upvotes: 1

Related Questions