thymeleaf textarea 赋值

位置:首页>文章>详情   分类: 教程分享 > Java教程   阅读(3983)   2023-03-28 11:29:14
本文说一下在thymeleaf模板引擎中,如何给 textarea 赋值。
普通的input赋值我们是这样的
<input type="text" class="form-control" placeholder="搜索标题" name="searchTitle" th:value="${site.searchTitle}">
但是textarea标签的赋值方式并非上面这样,而是以下面的方式赋值:
<textarea name="searchDescription" type="text"  style="width: 100%;resize: none;" rows="3" class="form-control" placeholder="搜索描述" th:text="${site.searchDescription}"></textarea>

好了搞定!!!
标签: thymeleaf textarea
地址:https://www.leftso.com/article/716.html

相关阅读

本文说一下在thymeleaf模板引擎中,如何给 textarea 赋值
SSH/SSM项目中如何集成thymeleaf?本文将讲解SSH/SSM项目中如何集成thymeleaf模板引擎
Thymeleaf 递归,Thymeleaf模板引擎递归展示如评论留言等场合适用
js/jQuery获取textarea的光标位置实现光标位置插入内容
thymeleaf模板 报错信息:​​​​​​​org.thymeleaf.exceptions.TemplateInputException: Error resolving template...
thymeleaf 设置不校验html标签
springboot 使用thymeleaf 模板引擎中url中的&引起的org.xml.sax.SAXParseException: 对实体 "uid" 的引用必须以 ';' 分隔符结尾。问题解决
ckeditor绑定keyup/keydown等事件实现一些功能,比如实时保存$(function(){//1编辑器初始化$('textarea#blog_content').ckeditor();
一、项目环境Spring Boot 2.1.2.RELEASEshiro-spring 1.4二、去掉URL jsessionid在shiro配置中,配置关闭url中显示sessionId ...