"<select name='ccrseid' MULIPLE SIZE=10>";
If you want to do things without submitting, then you must use javascript to do so.
urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24
why should use MULIPLE SIZE=10..? what is the meaning?
I guess If you want allow user to select multiple items. It will show 10 items in one screen.
urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24
Hi,
I have modified the code of vibhadevit for you. hope this helps.
<?php
$link = mysql_connect('localhost','palak','palak');
$seldb = mysql_select_db('apalgujarati',$link);
$getuserqry = mysql_query("select id,name from apal_user");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<script language="javascript">
function showMe(str)
{
document.getElementById('myDiv').innerHTML = ' You have selected : '+str;
}
</script>
<select name="ccrseid" onchange="showMe(this.value);">
<option value="">Select</option>
<?php
while($getuserrow = mysql_fetch_array($getuserqry))
{
?>
<option value="<?php echo $getuserrow['name']; ?>"><?php echo $getuserrow['name']; ?></option>
<?php } ?>
</select>
<div id="myDiv"></div>
</body>
</html>
This will fetch all of your data from the db and also display the selected name.
Hope this will work for you. :)
pbcomput
Junior Poster in Training
59 posts since Feb 2010
Reputation Points: 19
Solved Threads: 4
Skill Endorsements: 0