struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Feidt" <Gary.Fe...@childrensmn.org>
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
true";

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

Gary

>>> johnhurt@gmail.com 12/1/2006 12:35:48 PM >>>
Hi,
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
javascript
handling below.  Can anyone help me get around this easily? Thanks.

<input type="image"
onclick="strutsForm.myActionProp.value='takeaction';
strutsForm.myNameProp.value='<c:out value="${result.myWeirdName}"/>';
return
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message