RE: [PEAR] QF hierselect: quotes and javascript?
| From: | Mike Carter | Date: | Wed, 26 Nov 2003 11:21:03 +0000 |
| Subject: | RE: [PEAR] QF hierselect: quotes and javascript? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9153@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Ignatius Reilly [mailto:ignatius.reilly@free.fr]
>
> I do not know whether this is a bug or a feature.
>
> Say I want to create a hierselect. One of the selects is
> passed a value pair
> ( "1" => "O'Reilly" )
> The javascript will squeak because it fails to escape the quote:
> media_categ_8[1] = new Array('29', 'O'Reilly'); // produces a js error
>
> Of course I can not escape the string before passing the
> value to the select
> element the quote because the "O'Reilly" string will appear
> as the content
> node of an <option> tag:
> <option value="1">O\'Reilly</option> will not do.
Not tested, just a quick idea, but...
you could convert your strings to HTML entities first?
- Mike.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________