Quote:
Originally Posted by ronverdonk
Sorry that sample was a typo at my side. The statement I use is[html]<option value="This is a value">This is a value</option>[/html]
Ronald :cool:
I've just tried this and it worked perfectly
[HTML]
<?xml version="1.0" encoding="iso-8859-1"?>
<!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>
<title>Temp</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type = "text/css">
body { background-color: #ddd }
</style>
<script language = "JavaScript" type="text/javascript">
function test() {
sel = document.myForm.box;
selValue = sel.options[sel.selectedIndex].value;
alert(selValue);
}
</script>
</head>
<body>
<h1> Temp</h1>
<form name = "myForm" id="myForm" action="">
<tr>
<td><select name ="box"><option value="This is a value">This is a value</option></select></td>
</tr>
<tr>
<td>
<input name = "show" type = "button" value = "show"
onclick = "test()" /></td>
</tr>
</table>
</form>
</body>
</html
[/HTML]