Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

[S2] client validation problem

Nick Tucker

2006-12-31

Replies:


Hi

I have been having trouble with client side validation for some time.
I am not sure if this usage case has been reported before, or even if this
is the
right place to report it, as it is an old problem from webwork.

On experimenting with the quiz_client.jsp in the showcase application I
found that if I changed
the form tag to include an action attribute, then the javascript for the
form validation was not
generated. This was also the case when I switched to using freemarker rather
than jsp.

i.e.

<s:form method="post" validate="true" action="quizClient.action">
  <s:textfield label="Name" name="name"/>
  <s:textfield label="Age" name="age"/>
  <s:textfield label="Favorite color" name="answer"/>
  <s:submit/>
</s:form>

or

[@(protected)"]
  [@(protected)"/]
  [@(protected)"/]
  [@(protected)"/]
  [@(protected)/]
[/@(protected)]

So a simple work around for some of the client validation problems would be
to
only supply the action attribute when absolutely necessary.

I hope that this will be of some use.

Nick Tucker


--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.