Hello, I'm a new Spanish user and I am now learning Perl and I have one question. How can I refresh a scrolling list from the selected option of other scrolling list using data from a mysql database?"
For example, I have two scrolling lists and one of them is for select the country from a mysql database
The other scrolling list is about the States and it has to be refreshed by what the user has selected in the first scrolling list.
the code for the first scrolling list is easy but how I know the selected country and how I could refresh the data of the second scrolling list
print q(<select tabindex="3" name="country" my $dbh = DBI->connect('DBI:mysql:userxxxx', 'mysqldatabase', '*** +*****') || die "<p>Could not connect to database: $DBI::errstr</p>"; my $sth = $dbh->prepare('SELECT DISTINCT country FROM country ORDE +R BY country'); $sth->execute(); my $result; my $numero=1; print "<option value=\"0\">Please select an option</option>"; while ($result = $sth->fetchrow_array()) { print "<option value=\"$numero\"> $result</option>"; $numero++; } my $datom = param ( 'country' ); print "<p> $datom</p>"; $dbh->disconnect(); print "</select>\n<br>\n";
I believe that the answer must be easy... Thanks
In reply to Refresh Scrolling List by sergfuente@coiim.es
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |