struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mississippi John Hurt" <johnh...@gmail.com>
Subject Re: HTML Input field event with ' (quote) in name of var being set breaking javascript var assignment
Date Fri, 01 Dec 2006 19:47:53 GMT
I notice if the quote is escaped as...  \'
then it works fine, the problem is it will display wrong looking exactly
like above, so I have to escape it 2 different ways...
Using &#039; the default in most cases, but using the \' just for this
javascript workaround.
Is this correct, there's got to be a better way. I dont want to have 2
versions of the same name (coming from the db).

On 12/1/06, Mississippi John Hurt <johnhurt@gmail.com> wrote:
>
> Actually its escaping it fine but it just doesnt work... The rendered html
> looks like... Can anyone spot what's wrong? Don't see why this wouldn't set
> the myNameProp.
>
> <input type="image" onclick=
> "strutsForm.myActionProp.value='takeaction';
> strutsForm.myNameProp.value='NameBeforeQuote&#039;AfterQuote'; return true;"/>
>
>
> On 12/1/06, Christopher Schultz <chris@christopherschultz.net> wrote:
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > John,
> >
> > Mississippi John Hurt wrote:
> > > <input type="image" onclick="strutsForm.myActionProp.value='takeaction
> > ';
> > > strutsForm.myNameProp.value=' <c:out value="${result.myWeirdName}"/>';
> > > return
> > > true" property="takeaction" src="button.gif" >
> >
> > Sorry, I didn't see that you were using <c:out>. Is there a Struts tag
> > that can help you with this?
> >
> > If not, you might have to do it yourself by writing a short escaping
> > routine. You can even use the routine used in the patches to the bug I
> > mentioned in my last post.
> >
> > - -chris
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.5 (MingW32)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> >
> > iD8DBQFFcH2k9CaO5/Lv0PARAtaFAJ9mZh3zmhkjIpCNg2HNrhHmFgCHwACaA8vA
> > TBRXD56KDBA4sHvCUZ44BQ8=
> > =KHXN
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message