#!/usr/bin/perl use CGI qw(:all); my $js = <=0; i--) { if (olist.options[i].selected) { olist.options[i] = null; } } olist.selectedIndex = -1; } function selectAll() { var olist = document.getElementById('ordered_items'); for (var i = 0; i $js) ; #=============================================================================== my @titlelist; open FILE, "<$ENV{'DOCUMENT_ROOT'}/data/vault/titlelist.txt" or die $!; chomp (@titlelist = ); close FILE; print br() x 5; print start_form( action=>'/cgi-bin/admin.pl' ); print table( {class=>'user_form'}, Tr( td( {width=>'55%'}, 'Select items' ), td( {width=>'35%'}, popup_menu( -id=> 'title', -name=>'title', -values=>\@titlelist )), td( {width=>'10%'}, button(-name => 'add', -value => "add", -onclick => 'addFromList()'))), Tr( td( 'ask for something else if it is not listed on drop down menu' ), td( textfield( -name=>'requesttext',-id => 'requesttext' )), td( button(-name => 'request', -value => 'request', -onclick => 'addFromEntry()'))), Tr( td( 'Your Order list'), td( popup_menu(-name => 'ordered_items', -multiple => 1, -id => 'ordered_items')), td( button(-name => 'delete', -value => 'remove',-onclick => 'removeFromList()'))), Tr( td( 'Soemthing to remark on order' ), td( {colspan=>2}, textarea( -name=>'remark', -rows=>6, -columns=>35 ))), Tr( td( a( {href=>'/cgi-bin/show.pl?name=showbook'}, font( {size=>3, color=>'yellow'}, 'Change Order' ))), td( {colspan=>2}, submit( -name => 'Order!', -onclick => 'selectAll()' ))) ); print hidden(-name=>'date', -value=>$date); print hidden(-name=>'host', -value=>$host); print end_form(); print br() x 5; #=============================================================================== if(param('ordered_items')) { print h3('Your Order'),ul(map{li($_)} param('ordered_items')); } if(param('remark')) { print h3('Your remark'),param('remark'); } print end_html; __END__ #### print header(), start_html (-script => $js) ;