in reply to dynamic HTML pull down
Is that what you are looking for? It seemed from your original post you were going to be using the same list of countries each time, so I just created the dropdown list in a string and reused that each time.my $dd_country_str; unless(open(FILE, "<countries.txt")){ die "cannot read file"; }else{ $dd_country_str .= qq*<select name="countries">\n*; while(<FILE>){ if(/(.*):(.*)/i){ $dd_country_str .= qq*<option value="$1">$2</option>\n*; } } $dd_country_str .= qq*</select>\n*; close(FILE); } ###now call the dd_str you just built; my $first_dropdown = $dd_country_str; $first_dropdown =~ s/(value="$country_alias_you_want_selected")/$1 sel +ected="selected"/g; ###XHTML compliant print $first_dropdown; . . .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: dynamic HTML pull down
by csuhockey3 (Curate) on Nov 05, 2003 at 03:39 UTC | |
by injunjoel (Priest) on Nov 06, 2003 at 02:45 UTC |