[ic] Putting javascript in a select with item-options

Mike Heins interchange-users@icdevgroup.org
Thu Apr 24 14:30:01 2003


Quoting Chris Wenham (cwenham@synesmedia.com):
> On Thursday 24 April 2003 10:08 am, Mike Heins wrote:
> > I think you are running afoul of the quoting capability of that subtag
> > (remember, [PREFIX-thing] is not a real ITL tag) which doesn't include
> >
> > |.
> >
> > Try js='onUpdate=jsfunction();'. Or I believe you can format it as a Perl
> > hash:
> >
> > [item-options
> >         {
> >                 td => 1,
> >                 label => 1,
> >                 bold => 1,
> >                 price => 1,
> >                 js => q| onUpdate="jsfunction()"|,
> >         }]
> 
>  Hmm.. nope, this didn't work either. I turned on debugging to see what was 
> being passed to Vend::Options::tag_options. Like this:
> 
> ::logDebug("Pre-hash opt: $opt");
> 	$opt = get_option_hash($opt);
> 
>  When run with either of the above two lines, I see this in icdebug:
> 
> Vend::Options:debug: Pre-hash opt:  td=1 label=1 bold=1 price=1
> 
>  Is there an input validator that's throwing away the value of js?

It should accept anything up to the first closing square bracket.
Are you sure you aren't calling the wrong page? You should see a
change in your debug statement as you change the order of the parameters,
for example.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

Few blame themselves until they have exhausted all other possibilities.
 -- anonymous