Page is a not externally linkable
- Code, Content, and Presentation
-- HTML
---- drop down box selection to change text and image link


smallcompany - 6:56 am on Dec 5, 2010 (gmt 0)


Got it!

Question: Would this be the simplest way or it can be simplified further? Thanks

<!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>
<script type="text/javascript">
function addit(){
if(document.getElementById("widget").value=="wid1" && document.getElementById("option").value=="opt1")
{
document.getElementById("amount").value="$5.00"
}
if(document.getElementById("widget").value=="wid1" && document.getElementById("option").value=="opt2")
{
document.getElementById("amount").value="$10.00"
}
if(document.getElementById("widget").value=="wid2" && document.getElementById("option").value=="opt1")
{
document.getElementById("amount").value="$15.00"
}
if(document.getElementById("widget").value=="wid2" && document.getElementById("option").value=="opt2")
{
document.getElementById("amount").value="$20.00"
}
}
</script>
</head>

<body>
<form action="dd-html.php" method="get">
<select id="widget" name="widget" onChange="addit()">
<option value="wid1" selected="wid1">1 Widget</option>
<option value="wid2">2 Widgets</option>
</select>
<select id="option" name="option"onChange="addit()">
<option value="opt1" selected="opt1">Option 1</option>
<option value="opt2">Option 2</option>
</select>
<input type="submit" value="Buy now" />
<input type="text" id="amount" value="" style="border:none; font-size:13pt;">
</select>
</form>
</body>
</html>


Thread source:: http://www.webmasterworld.com/html/4238452.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com