Change isRequired star position in Struts 1
I am using Struts 1 on a form and need to mark some inputs as required. The thing is that the red star ('*') showing the required fields when marking them with isRequired="true"
is by default shown right after the textbox:
alt text http://img402.imageshack.us/img402/2345/input.png
Is there a way to change the star position to the left, right before "Input"?
If needed, t开发者_JAVA百科he code of this is now:
<layout:text property="input" key="form.input" styleClass="FormInput" mode="E,E,I" isRequired="true" />
You will likely have to write your own custom tag that basically extends the layout:text tag but overrides the output (i.e. where the star is generated if the field has an error).
Start here: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html You could probably skip ahead to the "Examples" page, but the other stuff is good to know too
精彩评论