Loading ...
Sorry, an error occurred while loading the content.

Creating a multi-select box via Perl not working

Expand Messages
  • geoffreymsilver
    I have the following Ajax function used to dynamically create a select box. I d like to make this a multi-select, and added two lines which I thought would
    Message 1 of 1 , Jan 14, 2011
    View Source
    • 0 Attachment
      I have the following Ajax function used to dynamically create a select box. I'd like to make this a multi-select, and added two lines which I thought would work; however, they are being ignored. (If I change "myDropDown" it is reflected in the HTML, so I'm sure I'm in the right section of code). I'm using Clearsilver 0.10.5.

      my $self = shift;
      return sub {
      my $hdf = $self->hdf;
      $hdf->setValue('Show.elem','select');
      $hdf->setValue('Select.name','myDropDown');

      # the following two lines were added, but don't seem to work
      $hdf->setValue('Select.multiple',1);
      $hdf->setValue('Select.size',8);

      my %sTypes = %{$self->cfg->{attrs}};
      foreach (sort(keys %sTypes)) {
      $hdf->setValue("Select.option.$_.label",$sTypes{$_});
      $hdf->setValue("Select.option.$_.selected",1)
      if $self->req->param('servertype') eq $_;
      }
      return $self->getCS($hdf,'show')->render;
      }

      Whether or not I quote the values of '1' and '8' doesn't seem to matter. Is there something I'm missing here, or is this a Clearsilver bug?
    Your message has been successfully submitted and would be delivered to recipients shortly.