Ver Mensaje Individual
  #3 (permalink)  
Antiguo 30/12/2008, 09:23
Avatar de Superlinux
Superlinux
 
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 19 años, 5 meses
Puntos: 1
Pregunta Respuesta: calcular valor

...

hola .. tengo la siguiente inquietud .. esta en mi funcion

Código PHP:
<script language="JavaScript">
<!--
Calcular valor
function calcular_valor(){
    var 
combo1=document.getElementById("idespecialidad");
    var 
combo2=document.getElementById("idCiudad");
    
// cogemos los valores
    
value1=combo1.value;
    
value2=combo2.value;
    
// los multiplicamos
    
total=value1*value2;
    
// mostramos el resultado
    
var newPara document.createElement("valor");
    return 
total;  
}
//-->
</script> 
asi es como calculo y ubico el valor

Código PHP:
<input name="Input" type="button" onClick="document.getElementById('valor').value=calcular_valor()" value="Vr">
     <input name="valor" type="text" class="fValidate['required']" id="valor" value="<?php echo $valor ?>" size="10" maxlength="10" />
.... necesitaria que si selecciono idEspecialidad y idCiudad... visualice el costo neto en un cuadro de texto y en otro cuandro de texto multiplique costo por 16%

esta es la tabla ..


CREATE TABLE `oferta_pos` (
`idOferta` int(11) NOT NULL auto_increment,
`idEspecialidad` int(11) default NULL,
`costo` float NOT NULL,
`descuento` int(2) NOT NULL,
`descripcion` text NOT NULL,
`idCiudad` int(11) default NULL,
`iva` int(2) NOT NULL,
`costoneto` float NOT NULL,
`nivel` int(1) default NULL,
`comision1` int(2) NOT NULL,
`comision2` int(2) NOT NULL,
PRIMARY KEY (`idOferta`),
KEY `idEspecialidad` (`idEspecialidad`),
KEY `idCiudad` (`idCiudad`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

.... gracias por la ayuda ...
__________________
"La vida sigue su curso, tú toma parte de ella."