name of select changed to avoid conflict:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function moveData(data) {
var parts = data.split('/');
var f = document.form1;
alert(parts[0]+":"+parts[1]);
f.quantity.value = parts[0];
f.price.value = parts[1];
}
</script>
<style type="text/css">
* {margin:0;padding:0;}
</style>
</head>
<body>
<form name="form1" action="http://www.domain.com/cgi-bin/submit.pl" method="post">
<select name="quantityprice" onchange="moveData(this.value);">
<option value="1/10">1 piece ($10 each)
<option value="2/9">2 pieces ($9 each)
<option value="3/8">3 pieces ($8 each)
<option value="4/7">4 pieces ($7 each)
<option value="5/6">5 pieces ($6 each)
</select>
<input type="text" name="quantity" value="--QUANTITY SELECTED ABOVE--">
<input type="text" name="price" value="--PRICE ASSOCIATED WITH THE SELECTED QUANTITY--">
<input type="submit" value="Submit">
</form>
</body>
</html>
At least 98% of internet users' DNA is identical to that of chimpanzees
Bookmarks