radio can't bind it value on 2.0.18

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

radio can't bind it value on 2.0.18

foolishchow

as the pic
<label style="padding-top: 8px;">
	<input type="radio" name="validflag" id="validflag1" th:value="${'1'}" /> 禁用
 </label>
<label style="padding-top: 8px;">
	<input type="radio" name="validflag" id="validflag2" th:value="${'0'}" checked="checked"/>启用
</label>
up the code , thymeledf seems didn't bind it's value under chrome.
 
Reply | Threaded
Open this post in threaded view
|

Re: radio can't bind it value on 2.0.18

danielfernandez
Administrator
You don't seem to be binding anything there. I assume you are using Spring -- in such case, you need to use the 'th:field' attribute for binding, not 'th:value'.

See http://www.thymeleaf.org/doc/html/Thymeleaf-Spring3.html for more details.