简体   繁体   中英

Grails, editable value in <g:select>

I want to give the users an opportunity to type in their own text if not in the list. This text should not be added to the list but it should be the value sent when the form is submitted. I have the feeling that this is not possible with the but what other solutions exist? This is common in windows applications at least.

Take a look at datalist

gsp:

<label>Choose an colour:
<input list="colours" name="aColour" /></label>
    <datalist id="colours">
        <option value="Red">
        <option value="Blue">
        <option value="White">
    </datalist>

controller:

params.aColour

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM