Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/02/2003, 22:23
Satan-666
 
Fecha de Ingreso: enero-2003
Ubicación: Madrid
Mensajes: 54
Antigüedad: 21 años, 2 meses
Puntos: 0
Ahi te va uno en Java, solo tienes que copiar y pegar

<html>
<head>
<!-- Copiar dentro del tag HEAD -->
<script LANGUAGE="JavaScript">
/* Copyright Reaz Hoque http://rhoque.com [email protected]
This code can be used for non-profit use only if the copyright notice is kept. */

var called=false;
var T_Price=0;
var Line1_flag;
var Line1_print="";
var Line2_flag;
var Line2_print;
var Line3_flag;
var Line3_print;
var Line4_flag;
var Line4_print;
var Line5_flag;
var Line5_print;
var Line6_flag;
var Line6_print;
function compute(form){
called=true;
//-------Productos 1----------
if (form.Productline1[0].selected){
Line1_print= "Ninguno [$0]";
Line1_flag=0;
}

if (form.Productline1[1].selected){
Line1_flag =84.95;
Line1_print="Producto 1 [$84.95]";
}
else if (form.Productline1[2].selected){
Line1_flag =84.95;
Line1_print="Producto 2 [$84.95]";
}

else if (form.Productline1[3].selected){
Line1_flag =54.95;
Line1_print="Producto 3 [$54.95]";
}

else if (form.Productline1[4].selected){
Line1_flag =54.95;
Line1_print="Producto 4 [$54.95]";
}
else if (form.Productline1[5].selected){
Line1_flag =19.95;
Line1_print="Producto 5 [$19.95]";
}
//-------Productos 2----------
if (form.Productline2[0].selected){
Line2_flag=0;
Line2_print="Ninguno [$0]";
}
if (form.Productline2[1].selected){
Line2_flag=150;
Line2_print="Producto 1 [$150]";
}
if (form.Productline2[2].selected){
Line2_flag=250;
Line2_print="Producto 2 [$250]";
}
if (form.Productline2[3].selected){
Line2_flag=350;
Line2_print="Producto 3 [$350]";
}
//-------Productos 3-----------
if (form.Productline3[0].selected){
Line3_flag=0;
Line3_print="Ninguno [$0]";
}
if (form.Productline3[1].selected){
Line3_flag=10;
Line3_print="Producto 1 [$10]";
}
if (form.Productline3[2].selected){
Line3_flag=20;
Line3_print="Producto 2 [$20]";
}
if (form.Productline3[3].selected){
Line3_flag=30;
Line3_print="Producto 3 [$30]";
}
//-------Productos 4-------
if (form.Productline4[0].selected){
Line4_flag=0;
Line4_print="Ninguno [$0]";
}
if (form.Productline4[1].selected){
Line4_flag=100;
Line4_print="Producto 1 [$100]";
}
if (form.Productline4[2].selected){
Line4_flag=200;
Line4_print="Producto 2 [$200]";
}
if (form.Productline4[3].selected){
Line4_flag=300;
Line4_print="Producto 3 [$300]";
}
//-------Productos 5-------
if (form.Productline5[0].selected){
Line5_flag=0;
Line5_print="Ninguno [$0]";
}
if (form.Productline5[1].selected){
Line5_flag=50;
Line5_print="Producto 1 [$50]";
}
if (form.Productline5[2].selected){
Line5_flag=60;
Line5_print="Producto 2 [$60]";
}
if (form.Productline5[3].selected){
Line5_flag=70;
Line5_print="Producto 3 [$70]";
}
//-------Productos 6-------
if (form.Productline6[0].selected){
Line6_flag=0;
Line6_print="Ninguno [$0]";
}
if (form.Productline6[1].selected){
Line6_flag=75;
Line6_print="Producto 1 [$75]";
}
if (form.Productline6[2].selected){
Line6_flag=85;
Line6_print="Producto 2 [$85]";
}
if (form.Productline6[3].selected){
Line6_flag=95;
Line6_print="Producto 3 [$95]";
}
T_Price=Line1_flag+Line2_flag+Line3_flag+Line4_fla g+Line5_flag+Line6_flag;
form.T_Price.value=" $ "+ T_Price;
}
function print(form){
if(!called){
compute(form);
}
text = ("<HEAD><TITLE>'Costo Estimado'</TITLE></HEAD>");
text = (text +"<BODY BGCOLOR = '#FFFFFF' ><CENTER><B><FONT SIZE = 3><FONT COLOR=BLUE>Costo Estimado</FONT></FONT></B>");
text= (text +"<br></CENTER>");
text=(text+"<hr>");
text=(text+"<TABLE BORDER =0><TR VALIGN=Top><TD VALIGN=Top>");
text=(text+"<B>Producto 1:<BR>Producto 2: <BR>Producto 3: <BR>Producto 4: <BR>Producto 5: <BR>Producto 6:");
text=(text+"</B></TD><TD>")
text=(text+"<B>"+ Line1_print+"<BR>"+ Line2_print+"<BR>"+ Line3_print+"<BR>");
text=(text+ Line4_print+"<BR>"+ Line5_print+"<BR>"+ Line6_print+"<BR>");
text=(text+"<TD></TR></TABLE><hr>");
text=(text+"<B><FONT COLOR=RED>Costo Total:</FONT>"+" $"+T_Price);
text=(text+"</body></html>");
msgWindow=window.open("","displayWindow","toolbar= no,width=320,height=240,directories=no,status=no,s crollbars=no,resize=no,menubar=no")
msgWindow.document.write(text)
msgWindow.document.close()
}
</script>
</head>

<body>
<!-- Copiar dentro del tag BODY -->
<form method="post">
<table cellpadding="4" bgcolor="#EAE8E8">
<tr>
<td><font face="Arial" size="2">Productos 1<br>
<select name="Productline1" size="1">
<option selected value="Seleccione">Libros</option>
<option value="Producto 1 [$84.95] ">Producto 1 [$84.95]</option>
<option value="Producto 2 [$84.95] ">Producto 2 [$84.95]</option>
<option value="Producto 3 [$54.95] ">Producto 3 [$54.95]</option>
<option value="Producto 4 [$54.95] ">Producto 4 [$54.95]</option>
<option value="Producto 5 [$19.95] ">Producto 5 [$19.95]</option>
</select></font></td>
<td><font face="Arial" size="2">Productos 2<br>
<select name="Productline2" size="1">
<option selected value="CD-Roms">CD-Roms</option>
<option value="Producto 1 [$150] ">Producto 1 [$150]</option>
<option value="Producto 2 [$250] ">Producto 2 [$250]</option>
<option value="Producto 3 [$350] ">Producto 3 [$350]</option>
</select></font></td>
<td><font face="Arial" size="2">Productos 3<br>
<select name="Productline3" size="1">
<option selected value="Postales">Postales</option>
<option value="Producto 1 [$10] ">Producto 1 [$10]</option>
<option value="Producto 2 [$20] ">Producto 2 [$20]</option>
<option value="Producto 3 [$30] ">Producto 3 [$30]</option>
</select></font></td>
</tr>
<tr>
<td><font face="Arial" size="2">Productos 4<br>
<select name="Productline4" size="1">
<option selected value="Llaveros">Servicios</option>
<option value="Producto 1 [$100] ">Producto 1 [$100]</option>
<option value="Producto 2 [$200] ">Producto 2 [$200]</option>
<option value="Producto 3 [$300] ">Producto 3 [$300]</option>
</select></font></td>
<td><font face="Arial" size="2">Productos 5<br>
<select name="Productline5" size="1">
<option selected value="Software">Software</option>
<option value="Producto 1 [$50] ">Producto 1 [$50]</option>
<option value="Producto 2 [$60] ">Producto 2 [$60]</option>
<option value="Producto 3 [$70] ">Producto 3 [$70]</option>
</select></font></td>
<td><font face="Arial" size="2">Productos 6<br>
<select name="Productline6" size="1">
<option selected value="Hardware">Hardware</option>
<option value="Producto 1 [$75] ">Producto 1 [$75]</option>
<option value="Producto 2 [$85] ">Producto 2 [$85]</option>
<option value="Producto 3 [$95] ">Producto 3 [$95]</option>
</select></font></td>
</tr>
<tr>
<td colspan="3"><table cellpadding="2">
<tr>
<td><font size="1"><br>
</font><input type="button" name="Price" value="Costo Total" onclick="compute(this.form)"><font
size="1"> </font><input type="text" size="12" name="T_Price" value></td>
<td valign="top"><font size="1"><br>
</font><input type="button" name="Print_data" value="Ver Detalles"
onclick="print(this.form)">&nbsp; <input type="button" value="Enviar"
onMouseup="javascript:alert('Esto es una prueba')"></td>
</tr>
<tr>
<td></td>
<td valign="top"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>