No se siquira como explicar esto pero, espero por lo menos ea el foro adecuado.
Estoy trabajando con un carro de compras gratuito en Java y quisiera que algunos datos (precio por ejemplo) sean tomados de una base de datos para no tener que actualizar uno a uno todos los meses. Es esto posible??
Le dejo el codigo de un ejemplo.
<SCRIPT SRC="language-en.js"></SCRIPT>
<SCRIPT SRC="nopcart.js">
//=========================================||
// NOP Design JavaScript Shopping Cart ||
// ||
// For more information on SmartSystems, or how NOPDesign can help you ||
// Please visit us on the WWW at http://www.nopdesign.com ||
// ||
// JavaScript Shop Module, V.4.3.0 ||
//=======================================||
</SCRIPT>
<SCRIPT>
function AddOneOfManyToCart(formToUpdate)
{
selectedObj = formToUpdate.PRODUCTSELECTOR[formToUpdate.PRODUCTSELECTOR.selectedIndex];
nameVal = selectedObj.getAttribute("name");
if (nameVal == "NOTHING") {
alert('Please select a product');
return false;
}
formToUpdate.NAME.value = nameVal;
costVal = selectedObj.getAttribute("cost");
formToUpdate.PRICE.value = costVal;
id_numVal = selectedObj.getAttribute("id_num");
formToUpdate.ID_NUM.value = id_numVal;
shippingVal = selectedObj.getAttribute("shipping");
formToUpdate.SHIPPING.value = shippingVal;
switch( formToUpdate.PRODUCTSELECTOR[formToUpdate.PRODUCTSELECTOR.selectedIndex].value ) {
}
AddToCart(formToUpdate);
}
</script>
<FORM NAME=order>
<font size="2" face="Arial, Helvetica, sans-serif">Qty</font>.
<input type=text size=2 maxlength=2 name=QUANTITY onChange='this.value=CKquantity(this.value)' value="1">
<input type=hidden name=PRICE value="">
<input type=hidden name=NAME value="">
<input type=hidden name=ID_NUM value="">
<input type=hidden name=SHIPPING value="">
<SELECT NAME="PRODUCTSELECTOR">
<OPTION cost="130" id_num="GPS-140" name="Datalogger with TF-30 buil-in for RS232" shipping="0">Datalogger with TF-30 buil-in for RS232 - u$s 130
<OPTION cost="135" id_num="GPS_140" name="Datalogger with TF-30 buil-in for USB" shipping="0">Datalogger with TF-30 buil-in for USB - u$s 135
</SELECT>
<input type=button value='Add to Cart' onClick='AddOneOfManyToCart(this.form)'>
<font size="2" face="Arial, Helvetica, sans-serif"><a href="managecart.html">Check out now</a> </font>
</FORM>
Gracias por adelantado.