struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Feidt" <>
Subject Re: HTML Input field event with ' (quote) in name of var being set breaking javascript var assignment
Date Fri, 01 Dec 2006 18:45:40 GMT
I don't work with <c:out/> tags, but why don't you create a String
variable and then use that in your onclick:

String strOnClick = whatever + "something else" + whatever2 + "return

<input type="image" onclick="<%= strOnClick %>" property="takeaction"
src="button.gif" >


>>> 12/1/2006 12:35:48 PM >>>
I have onclick handler which sets a form property via javascript.
Problem is
when the myWeirdName has a quote in the name, this breaks my
handling below.  Can anyone help me get around this easily? Thanks.

<input type="image"
strutsForm.myNameProp.value='<c:out value="${result.myWeirdName}"/>';
true" property="takeaction" src="button.gif" >

Confidentiality Statement:
This email/fax, including attachments, may include confidential
and/or proprietary information and may be used only by the
person or entity to which it is addressed. If the reader of 
this email/fax is not the intended recipient or his or her 
agent, the reader is hereby notified that any dissemination, 
distribution or copying of this email/fax is prohibited. If you 
have received this email/fax in error, please notify the sender 
by replying to this message and deleting this email or 
destroying this facsimile immediately.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message