Adding HTML5 placeholder attribute to spring 3.0 form input elements

前端 未结 2 595
难免孤独
难免孤独 2020-12-09 11:22

How do I add HTML5 placeholder attributes to Spring webmvc\'s form:input, form:password and form:textarea elements?

2条回答
  •  情书的邮戳
    2020-12-09 11:29

    Regarding the new input types question - I had success by using spring bind and manually generating the input element. I'm using bootstrap so I already had a tag to wrap the control-group and apply the error message, but if you just want to inline it you can do the following.

    if your path field was 'age', replace with

    
      
    
    

提交回复
热议问题