Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 placeholder inside Struts html:text tag

Tags:

html

struts-1

I'm using Struts 1.3.10 in a web application, and I want my textfields to have a placeholder. Unfortunately, the current Struts taglib doesn't recognize this attribute, and I would like to avoid using javascript for this if possible. Do you know any solution for this?

like image 564
Edgar Pérez Avatar asked Nov 05 '22 05:11

Edgar Pérez


1 Answers

Struts 1 is dead. It hasn't had a release since 2008. I would really think about migrating to a more modern framework.

If you're stuck with Struts 1, you could

  • edit the sources yourself, and add a placeholder attribute to the tag.
  • avoid using the tag, and go back to basic HTML + JSTL + EL :

    <input type="text" name="foo" value="<c:out value='${myForm.foo}' />" 
           placeholder="Enter foo here" />
    
like image 165
JB Nizet Avatar answered Nov 07 '22 21:11

JB Nizet