Formular s multivalued params
Honza Pazdziora
adelton na informatics.muni.cz
Pondělí Listopad 15 23:50:06 MET 1999
Listserver se nam zasekl na checksumu tela, preposilam. --adelton
On Mon, Nov 15, 1999 at 06:49:04PM +0100, Pavel Kunc wrote:
> for (@names) {$Pary{$_} = $query->param($_);}
Prvni chyba je, ze param() prirazujete skalaru:
If the parameter is multivalued (e.g. from multiple selections in a
scrolling list), you can ask to receive an array. Otherwise the
method will return a single value.
Druha chyba je, ze pary se stejnym klicem nelze nacpat do hashe - tabulka
%Pary=(author=>shakespeare,author=>goethe)
bude obsahovat jen posledni par. Vhodnejsi je
%Pary=(author=>[shakespeare,goethe]), coz
dostanete treba z
@{$Pary{author}} = $query->param(author)
--
home: kubitovi na mbox.[lantanet.]cz
Marek Kubita http://kubitovi.lantanet.cz/
Další informace o konferenci Perl