spring mvc: How Can I give the <form:textarea /> tag a default value?

前端 未结 7 1418
悲&欢浪女
悲&欢浪女 2021-01-18 17:19

I have a problem with giving the tag a default value.
When I created a .jsp file as follow,



        
7条回答
  •  情话喂你
    2021-01-18 17:58

    You have to use JS along with Spring MVC to make this work. This is what I did:

    1. Change your textarea to basic html as below:

       
        OR
       
      
    2. Add a hidden input field, using spring mvc:

      
      
    3. Add the following JavaScript:

      
      

提交回复
热议问题