Ver Mensaje Individual
Antiguo 20/04/2005, 18:44   #2
Byztor 
NaSíO pA La aLeGriA
 
Avatar de Byztor
 
Fecha de ingreso: 27/mar/2003
Mensajes: 5.410
Byztor A este paso se convertirá en leyenda de este foroByztor A este paso se convertirá en leyenda de este foroByztor A este paso se convertirá en leyenda de este foroByztor A este paso se convertirá en leyenda de este foroByztor A este paso se convertirá en leyenda de este foroByztor A este paso se convertirá en leyenda de este foroByztor A este paso se convertirá en leyenda de este foroByztor A este paso se convertirá en leyenda de este foroByztor A este paso se convertirá en leyenda de este foroByztor A este paso se convertirá en leyenda de este foroByztor A este paso se convertirá en leyenda de este foro
Código:







JS - E-Comerce                                                                                                        








  
 
Copiar
Imprimir
Reportar Error
Maximizar
Guardar Como:
 Mostrando 236 Lineas
 
1<html>
2<head>
3<!-- Copiar dentro del tag HEAD -->
4<script LANGUAGE="JavaScript">
5/* Copyright Reaz Hoque http://rhoque.com rhoque@rhoque.com
6This code can be used for non-profit use only if the copyright notice is kept. */
7
8var called=false;
9var T_Price=0;
10var Line1_flag;
11var Line1_print="";
12var Line2_flag;
13var Line2_print;
14var Line3_flag;
15var Line3_print;
16var Line4_flag;
17var Line4_print;
18var Line5_flag;
19var Line5_print;
20var Line6_flag;
21var Line6_print;
22function compute(form){
23called=true;
24//-------Productos 1----------
25if (form.Productline1[0].selected){
26 Line1_print= "Ninguno [$0]";
27 Line1_flag=0;
28}
29
30 if (form.Productline1[1].selected){
31 Line1_flag =84.95;
32 Line1_print="Producto 1 [$84.95]";
33}
34else if (form.Productline1[2].selected){
35 Line1_flag =84.95;
36Line1_print="Producto 2 [$84.95]";
37}
38
39else if (form.Productline1[3].selected){
40 Line1_flag =54.95;
41 Line1_print="Producto 3 [$54.95]";
42}
43
44else if (form.Productline1[4].selected){
45 Line1_flag =54.95;
46 Line1_print="Producto 4 [$54.95]";
47}
48else if (form.Productline1[5].selected){
49 Line1_flag =19.95;
50 Line1_print="Producto 5 [$19.95]";
51}
52//-------Productos 2----------
53if (form.Productline2[0].selected){
54 Line2_flag=0;
55 Line2_print="Ninguno [$0]";
56}
57if (form.Productline2[1].selected){
58 Line2_flag=150;
59Line2_print="Producto 1 [$150]";
60}
61if (form.Productline2[2].selected){
62 Line2_flag=250;
63Line2_print="Producto 2 [$250]";
64}
65if (form.Productline2[3].selected){
66 Line2_flag=350;
67Line2_print="Producto 3 [$350]";
68}
69//-------Productos 3-----------
70if (form.Productline3[0].selected){
71 Line3_flag=0;
72 Line3_print="Ninguno [$0]";
73}
74if (form.Productline3[1].selected){
75 Line3_flag=10;
76Line3_print="Producto 1 [$10]";
77}
78if (form.Productline3[2].selected){
79 Line3_flag=20;
80Line3_print="Producto 2 [$20]";
81}
82if (form.Productline3[3].selected){
83 Line3_flag=30;
84Line3_print="Producto 3 [$30]";
85}
86//-------Productos 4-------
87if (form.Productline4[0].selected){
88 Line4_flag=0;
89Line4_print="Ninguno [$0]";
90}
91if (form.Productline4[1].selected){
92 Line4_flag=100;
93Line4_print="Producto 1 [$100]";
94}
95if (form.Productline4[2].selected){
96 Line4_flag=200;
97Line4_print="Producto 2 [$200]";
98}
99if (form.Productline4[3].selected){
100 Line4_flag=300;
101Line4_print="Producto 3 [$300]";
102}
103//-------Productos 5-------
104if (form.Productline5[0].selected){
105 Line5_flag=0;
106 Line5_print="Ninguno [$0]";
107 }
108if (form.Productline5[1].selected){
109 Line5_flag=50;
110 Line5_print="Producto 1 [$50]";
111 }
112if (form.Productline5[2].selected){
113 Line5_flag=60;
114 Line5_print="Producto 2 [$60]";
115 }
116if (form.Productline5[3].selected){
117 Line5_flag=70;
118 Line5_print="Producto 3 [$70]";
119 }
120//-------Productos 6-------
121if (form.Productline6[0].selected){
122 Line6_flag=0;
123 Line6_print="Ninguno [$0]";
124 }
125if (form.Productline6[1].selected){
126 Line6_flag=75;
127Line6_print="Producto 1 [$75]";
128 }
129if (form.Productline6[2].selected){
130 Line6_flag=85;
131 Line6_print="Producto 2 [$85]";
132 }
133if (form.Productline6[3].selected){
134 Line6_flag=95;
135 Line6_print="Producto 3 [$95]";
136 }
137T_Price=Line1_flag+Line2_flag+Line3_flag+Line4_flag+Line5_flag+Line6_flag;
138form.T_Price.value=" $ "+ T_Price;
139}
140function print(form){
141if(!called){
142 compute(form);
143}
144text = ("<HEAD><TITLE>'Costo Estimado'</TITLE></HEAD>");
145text = (text +"<BODY BGCOLOR = '#FFFFFF' ><CENTER><B><FONT SIZE = 3><FONT COLOR=BLUE>Costo Estimado</FONT></FONT></B>");
146text= (text +"<br></CENTER>");
147text=(text+"<hr>");
148text=(text+"<TABLE BORDER =0><TR VALIGN=Top><TD VALIGN=Top>");
149text=(text+"<B>Producto 1:<BR>Producto 2: <BR>Producto 3: <BR>Producto 4: <BR>Producto 5: <BR>Producto 6:");
150text=(text+"</B></TD><TD>")
151text=(text+"<B>"+ Line1_print+"<BR>"+ Line2_print+"<BR>"+ Line3_print+"<BR>");
152text=(text+ Line4_print+"<BR>"+ Line5_print+"<BR>"+ Line6_print+"<BR>");
153text=(text+"<TD></TR></TABLE><hr>");
154text=(text+"<B><FONT COLOR=RED>Costo Total:</FONT>"+" $"+T_Price);
155text=(text+"</body></html>");
156 msgWindow=window.open("","displayWindow","toolbar=no,width=320,height=240,directories=no,status=no,scrollbars=no,resize=no,menubar=no")
157 msgWindow.document.write(text)
158 msgWindow.document.close()
159}
160</script>
161</head>
162
163<body>
164<!-- Copiar dentro del tag BODY -->
165<form method="post">
166 <table cellpadding="4" bgcolor="#EAE8E8">
167 <tr>
168 <td><font face="Arial" size="2">Productos 1<br>
169 <select name="Productline1" size="1">
170 <option selected value="Seleccione">Libros</option>
171 <option value="Producto 1 [$84.95] ">Producto 1 [$84.95]</option>
172 <option value="Producto 2 [$84.95] ">Producto 2 [$84.95]</option>
173 <option value="Producto 3 [$54.95] ">Producto 3 [$54.95]</option>
174 <option value="Producto 4 [$54.95] ">Producto 4 [$54.95]</option>
175 <option value="Producto 5 [$19.95] ">Producto 5 [$19.95]</option>
176 </select></font></td>
177 <td><font face="Arial" size="2">Productos 2<br>
178 <select name="Productline2" size="1">
179 <option selected value="CD-Roms">CD-Roms</option>
180 <option value="Producto 1 [$150] ">Producto 1 [$150]</option>
181 <option value="Producto 2 [$250] ">Producto 2 [$250]</option>
182 <option value="Producto 3 [$350] ">Producto 3 [$350]</option>
183 </select></font></td>
184 <td><font face="Arial" size="2">Productos 3<br>
185 <select name="Productline3" size="1">
186 <option selected value="Postales">Postales</option>
187 <option value="Producto 1 [$10] ">Producto 1 [$10]</option>
188 <option value="Producto 2 [$20] ">Producto 2 [$20]</option>
189 <option value="Producto 3 [$30] ">Producto 3 [$30]</option>
190 </select></font></td>
191 </tr>
192 <tr>
193 <td><font face="Arial" size="2">Productos 4<br>
194 <select name="Productline4" size="1">
195 <option selected value="Llaveros">Servicios</option>
196 <option value="Producto 1 [$100] ">Producto 1 [$100]</option>
197 <option value="Producto 2 [$200] ">Producto 2 [$200]</option>
198 <option value="Producto 3 [$300] ">Producto 3 [$300]</option>
199 </select></font></td>
200 <td><font face="Arial" size="2">Productos 5<br>
201 <select name="Productline5" size="1">
202 <option selected value="Software">Software</option>
203 <option value="Producto 1 [$50] ">Producto 1 [$50]</option>
204 <option value="Producto 2 [$60] ">Producto 2 [$60]</option>
205 <option value="Producto 3 [$70] ">Producto 3 [$70]</option>
206 </select></font></td>
207 <td><font face="Arial" size="2">Productos 6<br>
208 <select name="Productline6" size="1">
209 <option selected value="Hardware">Hardware</option>
210 <option value="Producto 1 [$75] ">Producto 1 [$75]</option>
211 <option value="Producto 2 [$85] ">Producto 2 [$85]</option>
212 <option value="Producto 3 [$95] ">Producto 3 [$95]</option>
213 </select></font></td>
214 </tr>
215 <tr>
216 <td colspan="3"><table cellpadding="2">
217 <tr>
218 <td><font size="1"><br>
219 </font><input type="button" name="Price" value="Costo Total" onclick="compute(this.form)"><font
220 size="1"> </font><input type="text" size="12" name="T_Price" value></td>
221 <td valign="top"><font size="1"><br>
222 </font><input type="button" name="Print_data" value="Ver Detalles"
223 onclick="print(this.form)">&nbsp; <input type="button" value="Enviar"
224 onMouseup="javascript:alert('Esto es una prueba')"></td>
225 </tr>
226 <tr>
227 <td></td>
228 <td valign="top"></td>
229 </tr>
230 </table>
231 </td>
232 </tr>
233 </table>
234</form>
235</body>
236</html>

Prueba esto saludos
__________________
Lo que no te destruye, te hace más fuerte

Última edición por Byztor; 20/04/2005 a las 18:47.
Byztor está desconectado
Respuesta rápida a este mensaje
Responder Citando Subir