Last active
December 29, 2015 15:19
-
-
Save yanhua365/7689753 to your computer and use it in GitHub Desktop.
Freemarker和Bootstrap结合高亮显示单个输入验证错误的消息
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#-- | |
* 结合bootstrap的样式,有错误的时候高亮显示字段 | |
* config是表单绑定的模型对象,targetVersion是它的一个属性 | |
--> | |
<@spring.bind "config.targetVersion"/> | |
<#assign error> | |
<#if spring.status.errorMessages?has_content>error</#if> | |
</#assign> | |
<div class="control-group ${error}"> | |
<label class="control-label" for="inputTargetVersion">升级后版本</label> | |
<div class="controls"> | |
<@spring.formInput 'config.targetVersion' 'placeholder="要升级到的版本" class="span4"'/> | |
<#if error?has_content> | |
<span class="help-inline"><@spring.showErrors "","" /></span> | |
</#if> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment