Re: Verified for Spam -RODIN- I2R: Howto Create An Actionable Button with CGI.pm Wijaya Edward wrote:
> Hi all,
>  
> I was resorting to this verbatim html print 
> to do the task:
>  
> print qq(\\n);
> print qq(\\n);
> print qq(\\n);
> print qq(\\n);
> print qq(\\n);
> print qq(\\n);
> I tried this with CGI.pm dialect, but doesn't seem to work:
>  print start_multipart_form(), 
>  print start_form(-method=>"POST",
>                  -action=>"myscript.cgi",
>              );
>  hidden( -name=>"analysis", -value=>"Light");
>  hidden( -name=>"organism", -value=>"S.cerevisiae");
>  hidden( -name=>"sequence", -value=>$fasta);
>  submit( -name=>'action', -value => 'Run MySCRIPT'), 
>  print endform;
>  
> Can anybody suggest how can it be done with CGI.pm?
> The complete code can be found here: http://dpaste.com/9026/plain/


You aren't printing the tags for the fields. hidden() and submit() return
the text of the tag to be printed, and if you do nothing with this value it
will simply be discarded. Try this:

print
  start_multipart_form(-action => 'myscript.cgi'),
  hidden(-name => 'analysis', -value => 'Light'),
  hidden(-name => 'organism', -value => 'S.cerevisiae'),
  hidden(-name => 'sequence', -value => $fasta),
  submit(-name => 'action',   -value =>  'Run MySCRIPT'), 
  endform;

and you should get something close to what you want.

HTH,

Rob

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/


