<form name="formAddDropOrder" action="dropshipping.html?type=2" method="post">
<table width="760" cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td height="30"><b>Please enter the SKU code and quantity of products:</b></td>
</tr>
<tr>
<td height="30"><div id="divAddProductPanel">SKU:<input type="text" size="20" class="inputSKUs" /> Quantity:<input type="text" value="1" size="10" class="inputQuantities" />
<a class="ifttop" href="#" οnclick="addProductPanel();"><img border="0" src="${global_templatePath}images/add_product.gif"/></a></div><span id="MyFile"/><input type="hidden" name="array_skus" id="array_skus" value="" /><input type="hidden" id="array_quantities" name="array_quantities" value="" /></td>
</tr>
<tr>
<td height="30" align="right"> </td>
</tr>
</tbody></table>
</form>
<script type="text/javascript">
<!--
function addProductPanel() {
var divCount = $("#divAddProductPanel div").length;
$("#divAddProductPanel").append("<div id=\"divNum"
+ divCount + "\"><label>SKU:</label><input type=\"text\" size=\"20\" class=\"inputSKUs\"/>"
+ "<label> Quantity:</label><input type=\"text\" size=\"10\" class=\"inputQuantities\" value=\"1\" "
+" style=\"background-color: rgb(255, 255, 255);\"/>"
+ "<label style=\"cursor: pointer;\" οnclick='removeProductPanel(\"divNum"+divCount+"\")'> <img border=\"0\" src=\"templates/images/cancel_product.gif\"/></label></div>");
}
function removeProductPanel(addProductPanelId) {
// debugger;
$("#" + addProductPanelId).remove();
}
function goAutoPay() {
openWindow("
http://www.focalprice.com/myhome/autopay.aspx?n
=" + $("#aAutoPay").attr("onum"));
}
function addDropOrder(){
var skus = "";
var skuArray = new Array();
skuArray = $(".inputSKUs");
for (var i = 0; i < skuArray.length; i++) {
if ($(skuArray
).val().length == 0) {
alert("The SKU is required.");
return 0;
}
else {
if (skus != "") {
skus += ",";
}
skus += $(skuArray).val();
}
}
$("#array_skus").val(skus);
//alert($("#array_skus").val());
var quantities = "";
var quantityArray = new Array();
quantityArray = $(".inputQuantities");
for (var i = 0; i < quantityArray.length; i++) {
if ($(quantityArray).val().length == 0) {
alert("The Quantity is incorrect.");
return 0;
}
else {
if (quantities != "") {
quantities += ",";
}
quantities += $(quantityArray).val();
}
}
$("#array_quantities").val(quantities);
//alert($("#array_quantities").val());
formAddDropOrder.submit();
}
-->
</script>
转载于:https://www.cnblogs.com/silverLee/archive/2009/11/05/1596829.html