Hello,
I have a drop down selection box with the options populated by a mysql query. Is it possible to allow a manual entry of an string for an option that is not currently in the drop down box?
If so, how can this be done?
Thanks.
Moderators: macek, egami, gesf



nanao550 wrote:Would it be possible for you to provide an example using javascript as you mention. I would like to see exactly what it would works like and how the code and structure would be like, and if it would be possible to apply this to php. I would like to avoid using javascript, because it can be disable by the browser.
Thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="put.php">
<input name="c1" type="text" id="c1">
<p><select name="select">
<option>1</option>
<option>2</option>
<option>3</option>
<?php echo("<option>".$c1."</option>") ?>
</select>
<input type="submit" name="Submit" value="Submit">
</p></form>
</body>
</html>

Return to PHP coding => General
Users browsing this forum: Google [Bot] and 3 guests