Home | Scripting Techniques
Big Marvin This site publishes web authoring works done by Big Marvin.

Creating Better Selection Lists

The SELECT tag provided by start HTML is very useful for creating menus. It can capture important events such as on change and on select. The OPTION tag within the SELECT only holds one value which in most cases is not enough. With a little scripting and innovation you can enhance this tag to your need.

<select name="menu1">
<option value=m1> Menu Item Number 1
<option value=m2> Menu Item Number 2
<option value=m3> Menu Item Number 3
</select>

<menuitem id=m1 value1="Menu Item 1" value2="1" value3="A" >
<menuitem id=m2 value1="Menu Item 2" value2="2" value3="B" >
<menuitem id=m3 value1="Menu Item 3" value2="3" value3="C" >

The MENUITEM tags can be used as a reference for "menu" by calling some functions.

<script languae=javascript>
function showvalues(select_id, value_name) {
menuitem_id=document.all(select_id).value
return eval('document.all(menuitem_id).' + value_name);
}
</script>

example:



Value1
Value2
Value3




Email me at: big_marvin@hotmail.com

1