in reply to Passing 'SELECT MULTIPLE' parameters and CGI

However whilst what I have in the called perl program may be wrong - since I can see in the error log I'm getting the error "Can't call method "param" on an undefined value"

$query is undefined because you never created it. Add use strict; and use warnings; to the head of your script. Then decide how you want to use the CGI module: Choose between OOP way and non-OOP way. For the OOP way, create an instance of the CGI class: my $query=CGI->new();. For the non-OOP way, call param() as a function, not as a method, i.e. remove $query->.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: Passing 'SELECT MULTIPLE' parameters and CGI
by viffer (Beadle) on Aug 17, 2010 at 16:43 UTC
    Thanks guys, but I'm not even getting the value in 'runs' to worry about changing the query part. I will fix that up (thank you) as soon as I manage to actually pass multiple values to the called program.
    Incidentally I do have warnings and strict, I just pasted snippets.

    The weird thing is I have

    my $selectline = '<SELECT name="runs" MULTIPLE size="15" id="runs">'; print $selectline;

    Running it in debug, that's what appears to be printed, yet when I look at the source on IE8 it has it as

    <select name="runs" id="runs" size="15" multiple="multiple">

    and firefox has it as

    <select id="runs" size="15" multiple="" name="runs">

    In both instances it seems to have changed the order and set MULTIPLE to either "" or "multiple".
    I'm wondering if it's simply not picking up the 'multiple' setting as it correctly passes down individually selected items but not multiple selections,

      In both instances it seems to have changed the order and set MULTIPLE to either "" or "multiple".

      The value of multiple doesn't matter, just the presence or absence of the attribute.

        I think this is only true for HTML, but XHTML insists on having a value for multiple, and it must be multiple. The same applies to checked and other "no-value" attributes.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)