You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Kurt Post <kp...@cfl.rr.com> on 2003/07/22 00:03:44 UTC

RE: DO NOT REPLY [Bug 21560] - JavascriptValidatorTag creates invalida javascript method name when validating using action path in formName

I was working last week with validation based on actionpath as opposed to
ActionForm name and I had the same problem.  I worked around it by using the
"method" attribute of <html:javascript>, but it did feel kind of like a
hack.

I did try leaving the '/' out of the <html:javascript> tag and that resulted
in no validation.  I saw this on Struts 1.1.

I really think you should consider leaving this as a valid low priority bug.
I would think the fix would be very simple to implement and it would make
life easier for people who are doing action path based validation for the
first time.

-----Original Message-----
From: bugzilla@apache.org [mailto:bugzilla@apache.org]
Sent: Monday, July 21, 2003 4:57 PM
To: struts-dev@jakarta.apache.org
Subject: DO NOT REPLY [Bug 21560] - JavascriptValidatorTag creates
invalida javascript method name when validating using action path in
formName


DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21560>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21560

JavascriptValidatorTag creates invalida javascript method name when
validating using action path in formName

sraeburn@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From sraeburn@apache.org  2003-07-21
20:56 -------
You don't need to specify the forward slash in your validator configuration.
This configuration works for an Action with a path /myAction -

JSP:
  <html:javascript formName="myAction" />
  <html:form action="/myAction"  onsubmit="return validateMyAction(this);">

Validation.xml
  <form name="myAction" onsubmit="return validateMyAction(this);">

If, for any reason, you did need to include the forward slashes, you can use
the
'method' attribute of the <html:javascript> to specify a different
javascript
method name than the default. e.g.
  <html:javascript formName="/myAction" method="validateMyAction" />

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


RE: DO NOT REPLY [Bug 21560] - JavascriptValidatorTag creates invalida javascript method name when validating using action path in formName

Posted by Steve Raeburn <sr...@apache.org>.

> -----Original Message-----
> From: Kurt Post [mailto:kpost@cfl.rr.com]
> Sent: July 21, 2003 3:04 PM
> To: Struts Developers List
> Subject: RE: DO NOT REPLY [Bug 21560] - JavascriptValidatorTag creates
> invalida javascript method name when validating using action path in
> formName
>
>
> I was working last week with validation based on actionpath as opposed to
> ActionForm name and I had the same problem.  I worked around it
> by using the
> "method" attribute of <html:javascript>, but it did feel kind of like a
> hack.

Not ideal, I'll grant you, but not a hack :-). The "method" attribute exists
for exactly this type of situation.

> I did try leaving the '/' out of the <html:javascript> tag and
> that resulted in no validation.  I saw this on Struts 1.1.

My bad. I knocked up a quick test that appeared to work, but it only did so
because it was triggering a client side validation error and not getting
passed to the server.

> I really think you should consider leaving this as a valid low
> priority bug.
> I would think the fix would be very simple to implement and it would make
> life easier for people who are doing action path based validation for the
> first time.

I think this would classify as an enhancement as there is an existing
solution that works. Moving forward, the whole area of validator action
forms could probably do with another look.

Steve

>
> -----Original Message-----
> From: bugzilla@apache.org [mailto:bugzilla@apache.org]
> Sent: Monday, July 21, 2003 4:57 PM
> To: struts-dev@jakarta.apache.org
> Subject: DO NOT REPLY [Bug 21560] - JavascriptValidatorTag creates
> invalida javascript method name when validating using action path in
> formName
>
>
> DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
> RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
> <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21560>.
> ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
> INSERTED IN THE BUG DATABASE.
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21560
>
> JavascriptValidatorTag creates invalida javascript method name when
> validating using action path in formName
>
> sraeburn@apache.org changed:
>
>            What    |Removed                     |Added
> ------------------------------------------------------------------
> ----------
>              Status|NEW                         |RESOLVED
>          Resolution|                            |INVALID
>
>
>
> ------- Additional Comments From sraeburn@apache.org  2003-07-21
> 20:56 -------
> You don't need to specify the forward slash in your validator
> configuration.
> This configuration works for an Action with a path /myAction -
>
> JSP:
>   <html:javascript formName="myAction" />
>   <html:form action="/myAction"  onsubmit="return
> validateMyAction(this);">
>
> Validation.xml
>   <form name="myAction" onsubmit="return validateMyAction(this);">
>
> If, for any reason, you did need to include the forward slashes,
> you can use
> the
> 'method' attribute of the <html:javascript> to specify a different
> javascript
> method name than the default. e.g.
>   <html:javascript formName="/myAction" method="validateMyAction" />
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org