Mark Martin wrote:
Thanks Prabu ,
Works great. I'm not having any luck finding good documentation on this so I'll throw 2 more questions at you if that's okay:

Is there a method for setting the selected value as with the html below? Also, is it possible to display meaningful text instead of the value as with the html below?

<select name="'dropdown'" size="1">
                        <option value="one">On
                        <option value="two" selected>Off
                </select>

Cheers,
Mark



Hello Mark,

Hope this helps you,

#!/usr/bin/perl
use CGI;
$p = new CGI;
print $p->header;
print $p->start_html();
%attributes = ('on'=>{'name'=>'one'},'off'=>{'name'=>'two'});
print $p->popup_menu(-name=>'dropdown', -size=>'1',
                                 -values=>['on','off'],
-default=>'off',-attributes=>\%attributes);
print $p->end_html;



---
Prabu.M.A


At 16:59 16/06/2006 +0530, Prabu Ayyappan wrote:
On 6/16/06, Mark Martin <[EMAIL PROTECTED]> wrote:

Hi,
does anybody have the correct syntax for using a drop down list.
I'm using the object oriented type syntax for CGI. For example my text
boxes are printed thus :

$cgi = new CGI;
print $cgi->input({-type=>"text",-name=>"textbox01",-class=>"textbox"})

drop down list innormal html would be  :

<select name="selectName" size="1">
                        <option value="one">First
                        <option value="two">Second
                        <option value="three">Third
                </select>

cant figure out for cgi . . . .??

Cheers,
Mark


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


See a small program for dropdown (popup_menu)

#!/usr/bin/perl

use CGI;
$p = new CGI;
print $p->header;
print $p->start_html();
print
$p->popup_menu(-name=>'dropdown',-values=>['one','two','three','four']);
print $p->end_html;


--
Prabu M A



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to