Search
 
SCRIPT & CODE EXAMPLE
 

HTML

how to set a default value for a dropdownlist in html with thymeleaf spring

    <label for="drink">Drink</label>
    <select id="drink" name="drink">
        <option th:each="drink : ${drinks}" th:text="${drink.name}"                //drinks are an array of ENUMs here, drink.name are the lowercase equivalent
                th:value="${drink}" th:selected=${drink==customer.drink}></option> //the customer's last drink will be the default
    </select>
Comment

PREVIOUS NEXT
Code Example
Html :: font awesome show password icon 
Html :: How to write a empty character in HTML 
Html :: HOW TO USE A video on a html website from youtube 
Html :: country code for continents 
Html :: how do you play audio files on html 
Html :: What is the browser default background color for selected text 
Html :: html5 iframe youtube loop 
Html :: hide html element show on print bootstrap 4.6 
Html :: input cursor color 
Html :: sort table in html 
Html :: display subtitles with audio html 
Html :: how to make a link in html that opens in a new tab 
Html :: how to add multiple CSS inline html 
Html :: html width 
Html :: euro html 
Html :: input field in dropdown 
Html :: data list in input tag html 
Html :: call to action phone number 
Html :: what is the difference between span and div 
Html :: ng for until number 
Html :: tailwind css file input 
Html :: new line html 
Html :: non editable text field 
Html :: html downloading a file 
Html :: html date 
Html :: js get file from input 
Html :: how to add jquery to shopify 
Html :: dot icon in html 
Html :: form input autocomplete off 
Html :: change text direction in html 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =