I am populating the drop down menu from database. And when I submit the form I am getting empty string in selected option. Here's my code any help will be appreciated. I have selected the first option as default any help.
print "<br>Name: <select>";
while ( my ($name) = fetchrow_array() ) {
if ($name eq "Somethinge") {
print "<option value=\"$name\" selected>" . $name . "</option>\n";
}else {
print "<option value=\"$name\">" . $name . "</option>\n";
}
}
print "</select>";
I am getting the value using below but its returning empty whatever I select.
my $Name = param('name');