Pessoal como eu posso arumar esse codigo , estou colocando um jummenu com os nomes das cidades e estou querendo fazer de acordo com a cidade o preço da variavel (valor_m3) mude alguem me ajuda ae .
Código :
Código :
<!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=iso-8859-1" />
<script language="Javascript">
//valor do m3 .
var valor_m3 = 6 ;
function simular_orçamento(form) {
var total = ( eval(( valor_m3 * form.m3.value ) )) ;
if (total < 60 ) {
form.resultado.value = " Valor Minimo 60 Euros " ;
}
else if (form.m3.value < 1 ) {
form.resultado.value = " Preencha o Campo Volume " ;
} else {
form.resultado.value = total + " Euros " ;
}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
</script>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel='stylesheet' type='text/css'>
<!-- Estilos feitos sob encomenda para esse modelo -->
<link href="css/templatemo_style.css" rel='stylesheet' type='text/css'>
<style type="text/css">
<!--
.style1 {color: #333366}
.style2 {color: #FF0000}
#Layer1 {
position:absolute;
width:127px;
height:55px;
z-index:1;
left: 292px;
top: 46px;
}
-->
</style>
<style type="text/css">
.style11 {
color: #000000;
font-weight: bold;
}
#Layer2 {
position:absolute;
width:392px;
height:33px;
z-index:1;
left: 559px;
top: 74px;
}
.style14 {color: #0000FF;
font-size: 18px;
font-weight: bold;
}
.style15 {
font-family: "Courier New", Courier, monospace;
color: #000000;
font-size: 16;
}
</style>
<title>Simulador Online</title><form class="style1" >
<p align="center"> </p>
<p align="center"><span class="style14">
Orçamento</span></p>
<p align="center">
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
<option>Porto</option>
<option>Lisboa</option>
<option>outros</option>
</select>
</p>
<p align="center"><span class="style11">Volume : </span>
<input name="m3" type="text" size="20" maxlength="5" placeholder="m³" />
<p align="center">
<p align="center">
<input type="reset" value= "Limpar" class="btn btn-lg btn-orange" />
<input name="button" type="button" onclick="simular_orçamento (this.form)" value="Simular" class="btn btn-lg btn-green" />
<p align="center"><span class="style11">Valor Estimado :</span>
<input name="resultado" type="text" size="30" maxlength="0" />
</p>
<p class="style2"> </p>
</form>
<form action="" method="post" name="form1" class="style2" >
<div align="center">
<ul>
<li class="style15">Orçamento Minimo 60 Euros .</li>
</ul>
</div>
</form>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="Javascript">
//valor do m3 .
var valor_m3 = 6 ;
function simular_orçamento(form) {
var total = ( eval(( valor_m3 * form.m3.value ) )) ;
if (total < 60 ) {
form.resultado.value = " Valor Minimo 60 Euros " ;
}
else if (form.m3.value < 1 ) {
form.resultado.value = " Preencha o Campo Volume " ;
} else {
form.resultado.value = total + " Euros " ;
}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
</script>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel='stylesheet' type='text/css'>
<!-- Estilos feitos sob encomenda para esse modelo -->
<link href="css/templatemo_style.css" rel='stylesheet' type='text/css'>
<style type="text/css">
<!--
.style1 {color: #333366}
.style2 {color: #FF0000}
#Layer1 {
position:absolute;
width:127px;
height:55px;
z-index:1;
left: 292px;
top: 46px;
}
-->
</style>
<style type="text/css">
.style11 {
color: #000000;
font-weight: bold;
}
#Layer2 {
position:absolute;
width:392px;
height:33px;
z-index:1;
left: 559px;
top: 74px;
}
.style14 {color: #0000FF;
font-size: 18px;
font-weight: bold;
}
.style15 {
font-family: "Courier New", Courier, monospace;
color: #000000;
font-size: 16;
}
</style>
<title>Simulador Online</title><form class="style1" >
<p align="center"> </p>
<p align="center"><span class="style14">
Orçamento</span></p>
<p align="center">
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
<option>Porto</option>
<option>Lisboa</option>
<option>outros</option>
</select>
</p>
<p align="center"><span class="style11">Volume : </span>
<input name="m3" type="text" size="20" maxlength="5" placeholder="m³" />
<p align="center">
<p align="center">
<input type="reset" value= "Limpar" class="btn btn-lg btn-orange" />
<input name="button" type="button" onclick="simular_orçamento (this.form)" value="Simular" class="btn btn-lg btn-green" />
<p align="center"><span class="style11">Valor Estimado :</span>
<input name="resultado" type="text" size="30" maxlength="0" />
</p>
<p class="style2"> </p>
</form>
<form action="" method="post" name="form1" class="style2" >
<div align="center">
<ul>
<li class="style15">Orçamento Minimo 60 Euros .</li>
</ul>
</div>
</form>