print $query->scrolling_list

C

Chris

I have the following code and am trying to have different values than
what the user clicks on.

print $query->scrolling_list (
-name=>'forsale',
-value=>['No','Yes'],
-size=>2
-multiple=>'false');

Right now when I view my source in the browser it shows as
<SELECT NAME="forsale" SIZE=2 FALSE>
<OPTION VALUE="No">No
<OPTION VALUE="Yes">Yes
</SELECT>

and I need it to be (values below are different)
<SELECT NAME="forsale" SIZE=2 FALSE>
<OPTION VALUE="">No
<OPTION VALUE="s">Yes
</SELECT>

How would I change the print $query-> to allow this.

Thanks,
Chris
 
K

Keith Keller

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have the following code and am trying to have different values than
what the user clicks on.

print $query->scrolling_list (
-name=>'forsale',
-value=>['No','Yes'],
-size=>2
-multiple=>'false');

Right now when I view my source in the browser it shows as
<SELECT NAME="forsale" SIZE=2 FALSE>
<OPTION VALUE="No">No
<OPTION VALUE="Yes">Yes
</SELECT>

and I need it to be (values below are different)
<SELECT NAME="forsale" SIZE=2 FALSE>
<OPTION VALUE="">No
<OPTION VALUE="s">Yes
</SELECT>

How would I change the print $query-> to allow this.

Read the CGI documentation about using -labels.

- --keith

- --
(e-mail address removed)-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (Darwin)

iD8DBQFAkv6ohVcNCxZ5ID8RAq3UAKCQ/OzVbu6uQEQQ/mCbeHvMK5M3KgCgi7yw
/cX54sBYILmJN8+kodsbjkc=
=qHAX
-----END PGP SIGNATURE-----
 
B

Bob Walton

Chris said:
I have the following code and am trying to have different values than
what the user clicks on.

print $query->scrolling_list (
-name=>'forsale',
-value=>['No','Yes'],
-size=>2
-multiple=>'false');

Right now when I view my source in the browser it shows as
<SELECT NAME="forsale" SIZE=2 FALSE>
<OPTION VALUE="No">No
<OPTION VALUE="Yes">Yes
</SELECT>

and I need it to be (values below are different)
<SELECT NAME="forsale" SIZE=2 FALSE>
<OPTION VALUE="">No
<OPTION VALUE="s">Yes
</SELECT>

How would I change the print $query-> to allow this. ....

Chris


Did you miss the following in perldoc CGI?:


"The optional sixth argument is a pointer to an associative array
containing long user-visible labels for the list items (-labels). If not
provided, the values will be displayed."
 
C

Chris

I found the answer I was looking for. Thanks.

my %lables = (''=>'No',
's'=>'Yes');

print $query->scrolling_list (
-name=>'for_sale',
-value=>['','s'],
-default=>[''],
-size=>2,
-multiple=>'false',
-labels=>\%lables);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top