<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento senza titolo</title>
<script language="javascript">
function calcola(mod,qt){
var prezzi = new Array(
"120,160,195,260,390",
"130,180,225,295,450",
"160,225,290,430,690",
"0,0,0,380,570");
var m = mod.options[mod.selectedIndex].value;
var q = qt.options[qt.selectedIndex].value;
var p = prezzi[m].split(',');
var prezzo = p[q];
document.getElementById('prezzo').innerHTML="€ " + prezzo + ",00";
}
</script>
<script language="javascript">
function set_modello() {
var select_modello = document.form_acquisto.modello;
var select_quantita = document.form_acquisto.quantita;
var selected_modello = select_modello.options[select_modello.selectedIndex].value;
select_quantita.options.length=0;
if (selected_modello == "0") {for(var i=0; i<quantita_senza.length; i++) {select_quantita.options[select_quantita.options.length] = new Option(quantita_senza[i]);}}
if (selected_modello == "1") {for(var i=0; i<quantita_uno.length; i++) {select_quantita.options[select_quantita.options.length] = new Option(quantita_uno[i]);}}
if (selected_modello == "2") {for(var i=0; i<quantita_due.length; i++) {select_quantita.options[select_quantita.options.length] = new Option(quantita_due[i]);}}
if (selected_modello == "3") {for(var i=0; i<quantita_tre.length; i++) {select_quantita.options[select_quantita.options.length] = new Option(quantita_tre[i]);}}
}
var quantita_senza = new Array (
"Quantita",
"100",
"200",
"300",
"500",
"1000"
);
var quantita_uno = new Array (
"Quantita",
"100",
"200",
"300",
"500",
"1000"
);
var quantita_due = new Array (
"Quantita",
"100",
"200",
"300",
"500",
"1000"
);
var quantita_tre = new Array (
"Quantita",
"500",
"1000"
);
</script>
<style type="text/css">
<!--
#prezzo {
width:94px;
height:20px;
position:absolute;
font-size:17px;
font-weight:bold;
left: 7px;
top: 49px;
text-align:center;
}
-->
</style>
</head>
<body>
<form name="form_acquisto" method="post" action="registrazione.php">
<select name="modello" id="modello" onchange="if(this.options.selectedIndex!=0 && document.getElementById('quantita').options.selectedIndex!=0){calcola(this, document.getElementById('quantita'))}">
<option value="seleziona">Modello</option>
<option value="0">Senza lembi</option>
<option value="1">1 lembo</option>
<option value="2">2 lembi inc.</option>
<option value="3">3 lembi maxi</option>
</select>
<select name="quantita" id="quantita" onchange="if(this.options.selectedIndex!=0 && document.getElementById('modello').options.selectedIndex!=0 ){calcola(document.getElementById('modello'), this)}">
<option value="seleziona">Quantita</option>
</select>
<div id="prezzo">€ 0,00</div>
</form>
</body>