Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > print $query->scrolling_list

Reply
Thread Tools

print $query->scrolling_list

 
 
Chris
Guest
Posts: n/a
 
      05-01-2004
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
 
Reply With Quote
 
 
 
 
Keith Keller
Guest
Posts: n/a
 
      05-01-2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In article <> , Chris wrote:
> 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

- --
kkeller-
(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-----
 
Reply With Quote
 
 
 
 
Bob Walton
Guest
Posts: n/a
 
      05-01-2004
Chris wrote:

> 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."

--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl

 
Reply With Quote
 
Chris
Guest
Posts: n/a
 
      05-01-2004
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);
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
print a vs print '%s' % a vs print '%f' a David Cournapeau Python 0 12-30-2008 03:19 AM
Problem - I want to print Current Output of Pdf file and should print once.I get print dialog box but it is not working keto Java 0 05-30-2007 11:27 AM
Can't print to print server =?Utf-8?B?cGVjaw==?= Wireless Networking 2 02-03-2005 02:41 PM
How to make use of "print to file" option by print =?Utf-8?B?enljZ3M=?= MCSE 1 01-04-2005 06:50 PM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57