Can you select the items in the list with the keyboard?
Or the OnChange is triggered automaticly when you use the arrow keys?
Teddy,
My dear email address is [EMAIL PROTECTED]
----- Original Message -----
From: "Mike" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 06, 2002 6:28 AM
Subject: LISTBOX Problem
I am trying to populate a list box in a form with using the following
script and it works fine doing it this way:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<HTML><HEAD>\n";
print "<TITLE> Current Weather Products</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
#print "<select name=\"select\">\n";
print "<form name=\"form\">\n";
print "<select name=\"radar\"
onChange=\"window.location=document.form.radar.options[document.form.radar.s
electedIndex].value\">\n";
print "<option value=\"\">Zone Forecasts</option>\n";
chdir("/var/www/html/members/wx/zfp/") || die "Cannot chdir to
/var/www/html/members/wx/zfp/ ($!)";
while (<*>) {
print "<option
value=\"http://www.myserver.com/members/wx/zfp/$_\">$_</option> \n";
}
</select>\n
</BODY>\n
</HTML>\n
END
Here is the problem. If I change it to this:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print<<END
<HTML><HEAD>
<TITLE> Current Weather Products</TITLE>
</HEAD>
<BODY>
<form name=\"form\">
<select name=\"radar\"
onChange=\"window.location=document.form.radar.options[document.form.radar.s
electedIndex].value\">
<option value=\"\">Zone Forecasts</option>
END
chdir("/var/www/html/members/wx/zfp/") || die "Cannot chdir to
/var/www/html/members/wx/zfp/ ($!)";
while (<*>) {
print "<option
value=\"http://www.myserver.com/members/wx/zfp/$_\">$_</option> \n";
}
print<<END
</select>\n
</BODY>\n
</HTML>\n
END
It errors out Can someone help me with this?
syntax error at ./listfiles.pl line 13, near "chdir"
(Might be a runaway multi-line << string starting on line 4)
BEGIN not safe after errors--compilation aborted at ./listfiles.pl line
14.
Thanks Mike
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]