HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD><TITLE>Su1-0pm22</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<STYLE type=text/CSS>
</STYLE>
<SCRIPT type="text/javascript">
var opts=['Bread','Dessert'];
function addIt(x) {
var so='';
if(x){opts.push(x)}
for(i=0;i<opts.length;i++){so+='<option>'+opts[i]+'</option>'}
if(x){document.getElementById('category_dropdown').innerHTML=so}
else{return so;}
}
</SCRIPT>
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY scroll="auto">
<form name="recipe_form">
<input type="text" name="new_category_text">
<input type="button" name="add_category" value="Add Category" onclick="addIt(document.forms['recipe_form'].elements[0].value);">
<td style="border:none">
<select id="category_dropdown" name="category_dropdown" style="width:200px;height:75px;" multiple size="2">
<SCRIPT type="text/javascript">
document.write(addIt())
</SCRIPT>
</select>
</td>
</form>
Bread
Dessert
Meat
Pasta
Potatoes
Salad
</BODY></HTML>
Bookmarks