Código:
  
la funcion esta bien, el problema que tengo es que precio lo saco de un array function presta1()
	{
		valor3=parseFloat(document.getElementById('val3').value);
		valor4=parseFloat(document.getElementById('precio').value);
		
		
	
		document.getElementById('val4').value= valor3 * valor4 ;
		 }
Código PHP:
  
<script> 
function componer_Centros(cod_area) 
{ 
//alert(cod_area); 
document.miformulario.nombre.length=0;
 
document.miformulario.unidad.length=0;  
document.miformulario.precio.length=0;  
document.miformulario.nombre.options[0] = new Option("-- Seleccione --","","defaultSelected","");
 
document.miformulario.unidad.options[0] = new Option("-- Seleccione --","","defaultSelected",""); 
document.miformulario.precio.options[0] = new Option("-- Seleccione --","","defaultSelected",""); 
var indice=1; 
<? 
$sql_depto = "SELECT * from nom1 inner join un1 on nom1.id=un1.id inner join prec1 on un1.id=prec1.id"; 
$rs_depto = mysql_query($sql_depto, $con); 
if(mysql_num_rows($rs_depto)>0) 
{ 
while($row_depto = mysql_fetch_assoc($rs_depto)) 
{ 
 
?> 
if(cod_area=='<?=$row_depto["id"]?>') 
{ 
document.miformulario.nombre.options[indice] = new Option("<?=$row_depto["nombre"]?>","<?=$row_depto["id"]?>"); 
 
document.miformulario.unidad.options[indice] = new Option("<?=$row_depto["unidad"]?>","<?=$row_depto["id"]?>"); 
document.miformulario.precio.options[indice] = new Option("<?=$row_depto["precio"]?>","<?=$row_depto["id"]?>"); 
 
indice++; 
} 
<? 
} 
} 
mysql_close($con); 
?> 
 
 
} 
 
</script>   Este es el resto del codigo
Código PHP:
   <? 
$bd_host = "localhost"; 
$bd_usuario = "root"; 
$bd_password = "yoyoyo"; 
$bd_base = "a+i"; 
$con = mysql_connect($bd_host, $bd_usuario, $bd_password); 
mysql_select_db($bd_base, $con); 
$sql = "SELECT * from mat1"; 
$rs = mysql_query($sql, $con); 
?> 
 
 
 
<select name="clave" id="clave" onChange="componer_Centros(this.value);"> 
<option value="">--Seleccione--</option> 
<? if(mysql_num_rows($rs)>0) 
{ 
while($row = mysql_fetch_assoc($rs)) 
{ 
?> 
<option value="<?=$row["id"]?>"><?=$row["clave"]?></option> 
<? 
} 
} 
?> 
</select>
<select name="nombre" id="nombre">
<option>--seleccione--</option> 
</select>
<select name="unidad" id="unidad"> 
<option>--seleccione--</option> 
</select>
<select name="precio" id="precio"> 
<option>--seleccione--</option> 
</select>
</td>
 
 
<td>
Val 2:<input type="text" name="val2" id="val2"/>
</td>
<td>
Val 3:<input type="text" name="val3"  id="val3"/>
<input type="button" value="=" onClick="presta()">
</td>
<td>
Val 4:<input type="text" name="val4"  id="val4"/>
<input type="button" value="=" onClick="presta1()">
</td>
<td>   Saludos y Gracias
 
 

 Funcion Multiplicacion
 Funcion Multiplicacion 

