How to retrieve the value from Select html element using JS prototype in php?
Posted
by user309381
on Stack Overflow
See other posts from Stack Overflow
or by user309381
Published on 2010-04-06T07:06:15Z
Indexed on
2010/04/06
7:13 UTC
Read the original article
Hit count: 298
prototype
|JavaScript
<script type="text/javascript" src="prototype.js"></script>
<script>
function reload(form){
var val = $("seltab");alert(val);
}</script>
echo "<form method = post name = f1 action = '' >";
echo "<select id = seltab onchange = 'reload(this.form)'>";
$querysel = "SELECT title_id,author FROM authors NATURAL JOIN books";
$result1 = mysql_query($querysel) ;
while($rowID = mysql_fetch_assoc($result1))
{
$TitleID = $rowID['title_id'];
$author = $rowID['author'];
print "<option value =$TitleID>$author\n";
print "</option>";
}
print "</select>";
© Stack Overflow or respective owner