richardwakefield
asked on
Where is this form being validated?
I have a page on my e-commerce site mt_addproduct.asp which I use to add products to my product database. I have added 4 new fields (prodLink1 --> prodLink4) which are to be added to the database. When I try to submit the form without filling in all the fields I receive an error saying the fields prodLink1 prodLink2 prodLink3 and prodLink4 must be filled in. These fields aren't mandatory, so where is the code I need to change to stop them being mandatory (Javascript isn't my thing) :)
Thanks.
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------
[mt_addproduct.asp]
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------
<%
      Option Explicit
      Response.Buffer=True   Â
  Const vDebug = 0
  '------------------------- ---------- ---------- ---------- ---------- ---
'@BEGINVERSIONINFO
'@APPVERSION: 50.1003.0.1
'@FILENAME: MT_AddProduct.asp
     Â
'@FILEVERSION: 1.0.1
'@VERSIONDATETIME: 2/21/01
'@DESCRIPTION: Â web Admin tool
'@STARTCOPYRIGHT
'The contents of this file is protected under the United States
'copyright laws and is confidential and proprietary to
'LaGarde, Incorporated. Â Its use or disclosure in whole or in part without the
'expressed written permission of LaGarde, Incorporated is expressly prohibited.
'
'(c) Copyright 2000, 2001 by LaGarde, Incorporated. Â All rights reserved.
'@ENDCOPYRIGHT
'@ENDVERSIONINFO Â Â Â Â Â
%>
`<SCRIPT language="javascript" src="../../SFLib/sfCheckEr rors.js">< /SCRIPT>
<SCRIPT language="javascript">
      var bAddProduct
      bAddProduct = false
      function newCategory() {
           if (window.document.openerFor m.prodCate goryId.val ue == "New") {
                 window.document.openerForm .prodCateg oryNewId.d isabled = false
                 window.document.openerForm .prodCateg oryNewId.v alue = ""
           }
           else {
                 window.document.openerForm .prodCateg oryNewId.d isabled = true
                 window.document.openerForm .prodCateg oryNewId.v alue = "Select New Category"
           }     Â
      }
      function newMFG() {
           if (window.document.openerFor m.prodManu facturerId .value == "New") {
                 window.document.openerForm .prodManuf acturerNew Id.disable d = false
                 window.document.openerForm .prodManuf acturerNew Id.value = ""
           }
           else {
                 window.document.openerForm .prodManuf acturerNew Id.disable d = true
                 window.document.openerForm .prodManuf acturerNew Id.value = "Select New Manufacturer"
           }     Â
      }
      function newVendor() {
           if (window.document.openerFor m.prodVend orId.value == "New") {
                 window.document.openerForm .prodVendo rNewId.dis abled = false
                 window.document.openerForm .prodVendo rNewId.val ue = ""
           }
           else {
                 window.document.openerForm .prodVendo rNewId.dis abled = true
                 window.document.openerForm .prodVendo rNewId.val ue = "Select New Vendor"
           }     Â
      }
      function addproductCheck(form) {
      var sMes
           sMes=""
           var sExists
           var cnt           Â
          Â
           if (window.document.openerFor m.prodCate goryId.opt ions[windo w.document .openerFor m.prodCate goryId.opt ions.selec tedIndex]. value == "New") {
                      cnt=0
                 sExists=""
                 do
                 {
                 if (window.document.openerFor m.prodCate goryId.opt ions[cnt]. text==wind ow.documen t.openerFo rm.prodCat egoryNewId .value)
                 {sExists="1"}
                 cnt+=1;
                 } while(cnt<window.document. openerForm .prodCateg oryId.leng th);
                 if (sExists =="1"){
                      sMes=sMes+"Please fill in a unique category name.\n";
                      }
                 if (window.document.openerFor m.prodCate goryNewId. value ==""){
                      sMes=sMes+"Please fill in new category name.\n";
                      }}
           if (window.document.openerFor m.prodManu facturerId .options[w indow.docu ment.opene rForm.prod Manufactur erId.optio ns.selecte dIndex].va lue == "New") {
                                 cnt=0
                 sExists=""
                 do
                 {
                 if (window.document.openerFor m.prodManu facturerId .options[c nt].text== window.doc ument.open erForm.pro dManufactu rerNewId.v alue)
                 {sExists="1"}
                 cnt+=1;
                 } while(cnt<window.document. openerForm .prodManuf acturerId. length);
                 if (sExists =="1"){
                      sMes=sMes+"Please fill in a unique manufacturer name.\n";
                      }
                 if (window.document.openerFor m.prodManu facturerNe wId.value ==""){
                      sMes=sMes+"Please fill in a new manufacturer name.\n";
                      }}
           if (window.document.openerFor m.prodVend orId.optio ns[window. document.o penerForm. prodVendor Id.options .selectedI ndex].valu e == "New")      {
                            cnt=0
                 sExists=""
                 do
                 {
                 if (window.document.openerFor m.prodVend orId.optio ns[cnt].te xt==window .document. openerForm .prodVendo rNewId.val ue)
                 {sExists="1"}
                 cnt+=1;
                 } while(cnt<window.document. openerForm .prodVendo rId.length );
                 if (sExists =="1"){
                      sMes=sMes+"Please fill in a unique vendor name.\n";
                      }
     Â
                 if (window.document.openerFor m.prodVend orNewId.va lue =="")      {
                      sMes=sMes+"Please fill in new vendor name.\n"
                      }}
           if (sMes != "")      {
                 alert(sMes);
                 return false
                 }
          Â
var sName                      Â
           sName=window.document.open erForm.pro dID.value;
          Â
           if (bAddProduct) {
                 if (sName.indexOf("'",0) >= 0){
                      window.alert("Product Name can not contain apostrophes.\n");
                      return false
                      }
                 else
                 {     Â
                 if (sfCheck(form)) {
                      return true;
                 }
                 else {
                      bAddProduct = false;
                      return false;
                 }}
           }
           else {
                 return true;
           }
      }
      function addProductClicked() {
           bAddProduct = true
      }
</SCRIPT>
<!--#include file="../SFLib/db.conn.ope n.asp"-->
<!--#include file="../SfLib/incGeneral. asp"-->
<!--#include file="../SFLib/ADOVBS.inc" -->
<!--#include file="MT_incadmin.asp"-->
<!--#include file="../SFLib/incDesign.a sp"-->
<html>
<head>
<title>StoreFront Merchant Tools</title>
<SCRIPT language="javascript">
function helpMe(){
      var helpWin, loadHelp
      helpWin = window.open('help/prod_2.h tm','helpW in', 'scrollbars=1,resizable,lo cation=0,s tatus=0,to olbar=0,me nubar=0,he ight=300,w idth=500')
      helpWin.focus()
} Â Â Â Â Â
</SCRIPT>
</head>
<%
dim prodID, prodCategoryId, prodManufacturerId, prodVendorId, prodName, prodDescription, prodMessage
dim prodImageSmallPath, prodImageLargePath, prodLink, prodLink1, prodLink2, prodLink3, prodLink4, prodPrice, prodWeight, prodShip, Output, choice0, choice1, choice2, choice
dim prodShipIsAct, prodCountryTaxIsAct, prodStateTaxIsAct, prodEnabledIsAct, addAttribute, attNumber
dim addAttType, attNumDetail, rsProdInput, rsProdAttGet, counter, tempVar, tempVarName, tempVarPrice
dim tempVarSet, counter2, tempVar3, SQL, tempPrice, prodSalePrice, prodSaleIsAct, prodShortDescription, prodNamePlural, selected
dim Cvalue, Mvalue, Vvalue, rsNewCat, rsNewMFG, rsNewVen, iBookMark
dim prodCategoryNewId, prodManufacturerNewId, prodVendorNewId
dim prodLength,prodHeight,prod Width
'The page is devided into two area, confirmation area, and gathering input area
'Request all inputs           Â
prodID = Â Â Â Â Â Â Â Trim(Request.Form("prodID" ))
prodCategoryId = Â Â Â Trim(Request.Form("prodCat egoryId"))
prodManufacturerId = Â Trim(Request.Form("prodMan ufacturerI d"))
prodVendorId = Â Â Â Â Trim(Request.Form("prodVen dorId"))
prodCategoryNewId = Â Â Â Trim(Request.Form("prodCat egoryNewId "))
prodManufacturerNewId = Â Trim(Request.Form("prodMan ufacturerN ewId"))
prodVendorNewId = Â Â Â Â Trim(Request.Form("prodVen dorNewId") )
prodName = Â Â Â Â Â Â Trim(Request.Form("prodNam e"))
prodNamePlural = Â Â Â Trim(Request.Form("prodNam ePlural"))
prodDescription = Â Â Trim(Request.Form("prodDes cription") )
prodShortDescription =Trim(Request.Form("prodSh ortDescrip tion"))
prodMessage = Â Â Â Â Trim(Request.Form("prodMes sage"))
prodImageSmallPath = Â Trim(Request.Form("prodIma geSmallPat h"))
prodImageLargePath = Â Trim(Request.Form("prodIma geLargePat h"))
prodLink = Â Â Â Â Â Â Trim(Request.Form("prodLin k"))
prodLink1 = Â Â Â Â Â Â Trim(Request.Form("prodLin k1"))
prodLink2 = Â Â Â Â Â Â Trim(Request.Form("prodLin k2"))
prodLink3 = Â Â Â Â Â Â Trim(Request.Form("prodLin k3"))
prodLink4 = Â Â Â Â Â Â Trim(Request.Form("prodLin k4"))
prodPrice = Â Â Â Â Â Trim(Request.Form("prodPri ce"))
prodWeight = Â Â Â Â Â Trim(Request.Form("prodWei ght"))
if trim(prodWeight)="" then
prodWeight = Â Â Â Â Â 0
end if
      prodHeight =      Trim(Request.Form("prodHei ght"))
      if trim(prodHeight)="" then
           prodHeight =      0
      end if
      prodWidth =      Trim(Request.Form("prodWid th"))
      if trim(prodWidth)="" then
           prodWidth =      0
      end if
      prodLength =      Trim(Request.Form("prodLen gth"))
      if trim(prodLength)="" then
           prodLength =      0
      end if
prodSalePrice = Â Â Â Trim(Request.Form("prodSal ePrice"))
prodSaleIsAct = Â Â Â Trim(Request.Form("prodSal eIsAct"))
prodShip = Â Â Â Â Â Â Trim(Request.Form("prodShi p"))
prodShipIsAct = Â Â Â Trim(Request.Form("prodShi pIsAct"))
prodCountryTaxIsAct = Trim(Request.Form("prodCou ntryTaxIsA ct"))
prodStateTaxIsAct = Â Trim(Request.Form("prodSta teTaxIsAct "))
prodEnabledIsAct = Â Â Trim(Request.Form("prodEna bledIsAct" ))
addAttribute = Â Â Â Â Trim(Request.Form("addAttr ibute"))
attNumber = Â Â Â Â Â Trim(Request.Form("attNumb er"))
addAttType = Â Â Â Â Â Trim(Request.Form("addAttT ype"))
attNumDetail = Â Â Â Â Â Â Â Â Â Trim(Request.Form("attNumD etail"))
      'correct null data
      If prodShipIsAct="" Then
           prodShipIsAct= 0
      End If
     Â
      If prodCountryTaxIsAct="" Then
           prodCountryTaxIsAct= 0
      End If
      If prodStateTaxIsAct="" Then
           prodStateTaxIsAct= 0
      End If
      If prodEnabledIsAct="" Then
           prodEnabledIsAct= 0
      End If     Â
     Â
      If prodSaleIsAct="" Then
           prodSaleIsAct= 0
      End If     Â
'Confirmation and database insert area
If Request.Form("addproduct.x ") <>Â "" Then
      If prodShip = "" Then prodShip = 0
      If prodSalePrice = "" Then prodSalePrice = 0
      If attNumber = "" Then attNumber = 0     Â
      If prodCategoryId = "New" Then
           Set rsNewCat = Server.CreateObject("ADODB .RecordSet ")
           rsNewCat.CursorLocation = adUseClient
           rsNewCat.Open "sfCategories Order By catID", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
           rsNewCat.AddNew
           rsNewCat.Fields("catName") = Trim(Request.Form("prodCat egoryNewId "))
           rsNewCat.Update
          Â
           iBookMark = rsNewCat.AbsolutePosition
           rsNewCat.Requery
           rsNewCat.AbsolutePosition = iBookMark
          Â
           prodCategoryId = rsNewCat.Fields("catID")           Â
           rsNewCat.Close
           Set rsNewCat = nothing
      End If
     Â
      If prodManufacturerId = "New" Then
           Set rsNewMFG = Server.CreateObject("ADODB .RecordSet ")
           rsNewMFG.CursorLocation = adUseClient
           rsNewMFG.Open "sfManufacturers Order By mfgID", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
           rsNewMFG.AddNew
           rsNewMFG.Fields("mfgName") = Trim(Request.Form("prodMan ufacturerN ewId"))
           rsNewMFG.Update
          Â
           iBookMark = rsNewMFG.AbsolutePosition
           rsNewMFG.Requery
           rsNewMFG.AbsolutePosition = iBookMark
          Â
           prodManufacturerId = rsNewMFG.Fields("mfgID")
           rsNewMFG.Close
           Set rsNewMFG = nothing
      End If
     Â
      If prodVendorId = "New" Then
           Set rsNewVen = Server.CreateObject("ADODB .RecordSet ")
           rsNewVen.CursorLocation = adUseClient
           rsNewVen.Open "sfVendors Order By vendID", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
           rsNewVen.AddNew
           rsNewVen.Fields("vendName" ) = Trim(Request.Form("prodVen dorNewId") )
           rsNewVen.Update
          Â
           iBookMark = rsNewVen.AbsolutePosition
           rsNewVen.Requery
           rsNewVen.AbsolutePosition = iBookMark
          Â
           prodVendorId = rsNewVen.Fields("vendID")
           rsNewVen.Close
           Set rsNewVen = nothing
      End If
     Â
      'Input information into the database
      Set rsProdInput = Server.CreateObject("ADODB .RecordSet ")
      rsProdInput.Open "sfProducts", cnn, adOpenDynamic, adLockOptimistic, adCmdTable
     Â
      On Error Resume Next
      rsProdInput.AddNew
      rsProdInput.Fields("prodID ") = prodID
      rsProdInput.Fields("prodCa tegoryId") = prodCategoryId
      rsProdInput.Fields("prodMa nufacturer Id") = prodManufacturerId
      rsProdInput.Fields("prodVe ndorId") = prodVendorId
      rsProdInput.Fields("prodNa me") = prodName
      rsProdInput.Fields("prodNa mePlural") = prodNamePlural
      rsProdInput.Fields("prodDe scription" ) = prodDescription
      rsProdInput.Fields("prodSh ortDescrip tion") = prodShortDescription
      rsProdInput.Fields("prodMe ssage") = prodMessage
      rsProdInput.Fields("prodIm ageSmallPa th") = prodImageSmallPath
      rsProdInput.Fields("prodIm ageLargePa th") = prodImageLargePath
     Â
      rsProdInput.Fields("prodLi nk") = prodLink
      rsProdInput.Fields("prodLi nk1") = prodLink1
      rsProdInput.Fields("prodLi nk2") = prodLink2
      rsProdInput.Fields("prodLi nk3") = prodLink3
      rsProdInput.Fields("prodLi nk4") = prodLink4
                           Â
      rsProdInput.Fields("prodPr ice") = prodPrice
      rsProdInput.Fields("prodWe ight") = prodWeight
      rsProdInput.Fields("prodHe ight")       = prodHeight
      rsProdInput.Fields("prodLe ngth")       = prodLength
      rsProdInput.Fields("prodWi dth")       = prodWidth
      rsProdInput.Fields("prodSa lePrice") = prodSalePrice
      rsProdInput.Fields("prodSa leIsActive ") = prodSaleIsAct
      rsProdInput.Fields("prodSh ip") = prodShip
      rsProdInput.Fields("prodSh ipIsActive ") = prodShipIsAct
      rsProdInput.Fields("prodCo untryTaxIs Active") = prodCountryTaxIsAct
      rsProdInput.Fields("prodSt ateTaxIsAc tive") = prodStateTaxIsAct
      rsProdInput.Fields("prodEn abledIsAct ive") = prodEnabledIsAct
' Â Â Â Â Â rsProdInput.Fields("prodAt trNum") = attNumber
      rsProdInput.Fields("prodDa teAdded") = Now()
      rsProdInput.Update
      rsProdInput.Close
                Â
      rsProdInput.Open "sfAttributes", cnn, adOpenDynamic, adLockOptimistic, adCmdTable
     Â
      'Input Attribute Headers
      If Err.number = 0 Then
           counter = 1
           Do While Request.Form("T" & counter) <> ""
                 tempVar = "T" & counter
                 if trim(Request.Form(tempVar) )<>"" then
                 rsProdInput.AddNew
                 rsProdInput.Fields("attrPr odId") = prodID
                 rsProdInput.Fields("attrNa me") = Request.Form(tempVar)
                 rsProdInput.Update
                 end if
                 counter = counter + 1
           Loop
     Â
'+JF 9/27/01
           attNumber=counter-1
           rsProdInput.Close
     Â
      Set rsProdInput = Server.CreateObject("ADODB .RecordSet ")     Â
      SQL = "SELECT * FROM sfProducts WHERE prodID = '" & prodID & "'"
      rsProdInput.Open SQL, cnn, adOpenDynamic, adLockOptimistic, adCmdText
      'Input base product information
      rsProdInput.Fields("prodAt trNum")     = attNumber
      rsProdInput.update
      rsProdInput.close
'-JF 9/27/01 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
           SQL = "SELECT attrID, attrName FROM sfAttributes WHERE attrProdId = '" & prodID & "'"
           Set rsProdAttGet = Server.CreateObject("ADODB .RecordSet ")
           rsProdAttGet.Open SQL, cnn, adOpenForwardOnly, adLockOptimistic, adCmdText
     Â
           rsProdInput.Open "sfAttributeDetail", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
     Â
           'Input Attribute Details
           counter = 1
           Do While Not rsProdAttGet.EOF
                 tempVar = "T" & counter
                 tempVarName = "N" & counter
                 tempVarPrice = "P" & counter
                 tempVarSet = "S" & counter
                 If Request.Form(tempVar) = rsProdAttGet.Fields("attrN ame") Then
                      counter2 = 1
                      Do While Request.Form(tempVarName & counter2) <> ""
                            if trim(Request.Form(tempVarN ame & counter2))<>"" then
                            rsProdInput.AddNew
                            rsProdInput.Fields("attrdt AttributeI d") = rsProdAttGet.Fields("attrI D")
                            rsProdInput.Fields("attrdt Name") = Request.Form(tempVarName & counter2)
                            tempPrice = Request.Form(tempVarPrice & counter2)
                            If tempPrice = "" or isnull(tempPrice) Then
                                 rsProdInput.Fields("attrdt Price") = "0"
                            Else
                                 rsProdInput.Fields("attrdt Price") = tempPrice
                            End If
                            rsProdInput.Fields("attrdt Type") = Request.Form(tempVarSet & counter2)
                            rsProdInput.Update
                            end if
                            counter2 = counter2 + 1
                      Loop
                      rsProdAttGet.MoveNext
                      counter = 1
                 Else
                      counter = counter + 1
                 End If
           Loop     Â
     Â
           rsProdInput.Close
           rsProdAttGet.Close
     Â
           Set rsProdInput = nothing
           Set rsProdAttGet = nothing
      End If
prodID = Â Â Â Â Â Â Â ""
prodCategoryId = Â Â Â ""
prodManufacturerId = Â ""
prodVendorId = Â Â Â Â ""
prodCategoryNewId = Â Â Â ""
prodManufacturerNewId = Â ""
prodVendorNewId = Â Â Â Â ""
prodName = Â Â Â Â Â Â ""
prodNamePlural = Â Â Â ""
prodDescription = Â Â ""
prodShortDescription =""
prodMessage = Â Â Â Â ""
prodImageSmallPath = Â ""
prodImageLargePath = Â ""
prodLink = Â Â Â Â Â Â ""
prodLink1 = Â Â Â Â Â Â ""
prodLink2 = Â Â Â Â Â Â ""
prodLink3 = Â Â Â Â Â Â ""
prodLink4 = Â Â Â Â Â Â ""
prodPrice = Â Â Â Â Â ""
prodWeight = Â Â Â Â Â "0"
prodHeight = Â Â Â Â Â "0"
prodLength = Â Â Â Â Â "0"
prodWidth = Â Â Â Â Â "0"
prodSalePrice = Â Â Â ""
prodSaleIsAct = Â Â Â ""
prodShip = Â Â Â Â Â Â ""
prodShipIsAct = Â Â Â ""
prodCountryTaxIsAct = ""
prodStateTaxIsAct = Â ""
prodEnabledIsAct = Â Â ""
addAttribute = Â Â Â Â ""
attNumber = Â Â Â Â Â ""
addAttType = Â Â Â Â Â ""
attNumDetail = Â Â Â Â Â Â Â Â Â "" Â Â Â Â Â
End If
%> Â Â Â Â Â
<body background="<%= C_BKGRND %>" bgproperties="fixed" bgcolor="<%= C_BGCOLOR %>" link="<%= C_LINK %>" vlink="<%= C_VLINK %>" alink="<%= C_ALINK %>" onLoad="javascript:newCate gory();new MFG();newV endor();">
<form method="post" name="openerForm" id="openerForm" onSubmit=""><%'JF 9/27/01%>
<table border="0" cellpadding="1" cellspacing="0" bgcolor="<%= C_BORDERCOLOR1 %>" width="<%= C_WIDTH %>" align="center">
<tr>
<td>
  <table width="100%" border="0" cellspacing="1" cellpadding="3">
  <tr>
<% Â Â Â Â Â If C_BNRBKGRND = ""Â Then %>
<% Â Â Â Â Â Else %>
<% Â Â Â Â Â End If %> Â Â Â
  </tr>
  <tr>
      <td align="middle" background="<%= C_BKGRND2 %>" bgcolor="<%= C_BGCOLOR2 %>">
  <b><font face="Tahoma" color="#FFFFFF" size="4">Blue Vinyl</font><font face="<%= C_FONTFACE2 %>" color="<%= C_FONTCOLOR2 %>" SIZE="<%= C_FONTSIZE2 %>"> Merchant Tools</font></b></td>    Â
  </tr>
      <tr>
      <td bgcolor="<%= C_BGCOLOR3 %>" background="<%= C_BKGRND3 %>" width="100%" >Â
     Â
            <table border="0" width="100%">
    <tr>
    <td width="83%"><b>
    <font face="<%= C_FONTFACE3 %>" color="<%= C_FONTCOLOR3 %>" SIZE="<%= C_FONTSIZE3+1 %>">Store Inventory: Add A Product</font></b>
    <td width="17%" align="right">
    <A HREF="javascript:helpMe()" ><img src=images/help.jpg alt="Help" border="0"></A></td>
    </tr>
    </table>
 Â
       <tr>
      <td bgcolor="<%= C_BGCOLOR4 %>" background="<%= C_BKGRND4 %>" width="100%">
 Â
<%
If Err.number <>Â 0 Then
'If Err.number = 3705 Then
%>
     Â
                      <table cellpadding="5" cellspacing="0" bgcolor="<%= C_BGCOLOR4 %>" width="100%">
                      <tr><td width="100%" bgcolor="<%= C_BGCOLOR4 %>" align="center" background="<%= C_BKGRND5 %>">
                      <b><font face="<%= C_FONTFACE5 %>" color="#FF0000" size="<%= C_FONTSIZE5+2 %>"><b>Database Error
                      </font></b>
                      <br>
                      <b><font face="<%= C_FONTFACE5 %>" color="#FF0000" size="<%= C_FONTSIZE5 %>">Error Number= <%= Err.number%><br>Error Description= <%= Err.description %>
                      </td></tr>
                      </table>
<%
'End If
End If
If Request.Form("addproduct.x ") <>Â "" And Err.number = 0 Then
%>
                      <table cellpadding="5" cellspacing="0" bgcolor="<%= C_BGCOLOR4 %>" width="100%">
                      <tr><td width="100%" bgcolor="<%= C_BGCOLOR4 %>" align="center" background="<%= C_BKGRND5 %>">
                      <b><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4+2 %>"><b>Database Updated
                      </font>
                      <br><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"><a href="Menu.asp">Return to Merchant Tools</b></a>
                      </font></b>
                      </td></tr>
                      </table>
<%End If%>
 Â
    <table width="100%">
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>" height="19"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    General Product Information</font></b></td >
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product ID:</font></td>
    <td width="50%" height="22">
    <input type="text" name="prodID" title="Product ID" size="20" style="<%= C_FORMDESIGN %>" value="RCD"></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Name:</font></td>
    <td width="50%" height="22"><input type="text" name="prodName" title="Product Name" value="<%= prodName %>" size="20" style="<%= C_FORMDESIGN %>"></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Name Plural:</font></td>
    <td width="50%" height="22"><input type="text" name="prodNamePlural" title="Product Name Plural" value="<%= prodNamePlural %>" size="20" style="<%= C_FORMDESIGN %>"></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product
    Label:</font></td>
    <td width="50%" height="22"><select size="1" name="prodCategoryId" style="<%= C_FORMDESIGN %>" onChange="javascript:newCa tegory()">
    <%
    If prodCategoryId <> "New" Then
                 Response.write getCategoryList(prodCatego ryId)
                 selected = ""
           Else
                 Response.write getCategoryList(0)
                 selected = "selected"
                 Cvalue= Request.Form("prodCategory NewId")
           End If
    %><option <%= selected %> value="New">New Label</select><input type="text" name="prodCategoryNewId" value="<%= Cvalue %>" style="<%= C_FORMDESIGN %>" size=18></input></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product
     Category:</font></td>
    <td width="50%" height="22"><select size="1" name="prodManufacturerId" style="<%= C_FORMDESIGN %>" onChange="javascript:newMF G()">
    <%
    If prodManufacturerId <> "New" Then
      Response.write getManufacturersList(prodM anufacture rId)
      selected = ""
    Else
                 Response.Write getManufacturersList(0)
                 selected = "selected"
                 Mvalue = Request.Form("prodManufact urerNewId" )
           End If
    %><option <%= selected %> value="New">New Category</select><input type="text" name="prodManufacturerNewI d" value="<%= Mvalue %>" style="<%= C_FORMDESIGN %>" size=18></input></td>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product
     Vendor:</font></td>
    <td width="50%" height="22"><select size="1" name="prodVendorId" style="<%= C_FORMDESIGN %>" onChange="javascript:newVe ndor()">
    <%
    If prodVendorId <> "New" Then
      Response.write getVendorList(prodVendorId )
      selected = ""
    Else
                 Response.Write getVendorList(0)
                 selected = "selected"
                 Vvalue = Request.Form("prodVendorNe wId")
           End If
    %><option <%= selected %> value="New">New Vendor</select><input type="text" name="prodVendorNewId" value="<%= Vvalue %>" style="<%= C_FORMDESIGN %>" size=18></input></td>
     </select>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Price:</font></td>
    <td width="50%" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"><input type="text" name="prodPrice" title="Product Price" value="<%= prodPrice%>" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" valign="top" nowrap height="36"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Short Description :<br><font size="-1">(used on search.asp)</font></td>
    <td width="50%" height="36"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"><textarea rows="2" name="prodShortDescription " title="Product Short Description" cols="30" style="<%= C_FORMDESIGN %>"><%= prodShortDescription %></textarea>
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" valign="top" height="68"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Long Description :<br><font size="-1">(used on detail.asp)</font></font>< /td>
    <td width="50%" height="68"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"><textarea rows="4" name="prodDescription" cols="30" style="<%= C_FORMDESIGN %>"><%= prodDescription %></textarea>
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Confirmation Message:</font></td>
    <td width="50%" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"><input type="text" name="prodMessage" title="Product Message" value="<%= prodMessage%>" size="30" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" height="7" valign="top"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Link:</font></td>
    <td width="50%" height="7"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodLink" size="30" style="<%= C_FORMDESIGN %>" value="<%= prodLink%>">
    </font>
           </td>
    </tr>
    <tr>
    <td width="50%" align="right" height="4" valign="top"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Link1:</font></td>
    <td width="50%" height="4"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodLink1" size="30" style="<%= C_FORMDESIGN %>" value="<%= prodLink1%>"></font></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="4" valign="top"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Link2:</font></td>
    <td width="50%" height="4"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodLink2" size="30" style="<%= C_FORMDESIGN %>" value="<%= prodLink2%>"></font></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="4" valign="top"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Link3:</font></td>
    <td width="50%" height="4"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodLink3" size="30" style="<%= C_FORMDESIGN %>" value="<%= prodLink3%>"></font></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="4" valign="top"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Link4:</font></td>
    <td width="50%" height="4"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodLink4" size="30" style="<%= C_FORMDESIGN %>" value="<%= prodLink4%>"></font></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Weight:</font></td>
    <td width="50%" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodWeight" title="Product Weight" size="20" style="<%= C_FORMDESIGN %>" value="0.">
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Length:</font></td>
    <td width="50%"><font face="Verdana" size="2"><input type="text" title="Product Length" name="prodLength" value="<%= prodLength%>" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Width:</font></td>
    <td width="50%"><font face="Verdana" size="2"><input type="text" title="Product Width" name="prodWidth" value="<%= prodWidth%>" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Height:</font></td>
    <td width="50%"><font face="Verdana" size="2"><input type="text" title="Product Height" name="prodHeight" value="<%= prodHeight%>" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
   Â
    <tr>
    <td width="50%" align="right" height="20"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Activate Product:</font></td>
    <%If Request.Form("prodEnabledI sAct") = "" or Request.Form("addproduct.x ") <> "" Then %>
           <td width="50%" height="20">
    <input type="checkbox" name="prodEnabledIsAct" value="1" checked></td>
           <%Else%>
           <td width="50%" height="20"><input type="checkbox" name="prodEnabledIsAct" value="1" checked></td>
           <%End If%>
    </tr>
    <tr>
           <td colspan="2"> Â
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    Attributes</font></b></td>
    </tr>
    <tr>
    <td width="100%" colspan="2">
    <table width="100%" border="0">
    <%
           'Gathers Attribute information and displayes in correct HTML format
           addAttribute = Request.Form("AddAttribute .x")
           If addAttribute <> "" or addAttType = "Options" or Request.Form("actionType") = "Add Product" Then
                 If attNumber = "" and Request.Form("actionType") <> "Add Product" Then 'First Instance of Attribute being added
           %>
           <tr><td colspan="2"><hr></td></tr> <tr><td align="right" nowrap><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 + 1 %>">Attribute Title: </td><td><input type="text" title="Attribute Title" name="T1" size="15" style="<%= C_FORMDESIGN %>" optional=true></td></tr>
           <tr><td align="center" colspan="2"><input type="submit" name="addAttType" value="Options"></td></tr> <input type="hidden" name="attNumber" value="1">
           <%           Â
                 Else
                      counter = 1
                      Do While Request.Form("T" & counter) <> "" 'Loop which gathers Attribute Titles already added
                            tempVar = "T" & counter
                            tempVarName = "N" & counter
                            tempVarPrice = "P" & counter
                            tempVarSet = "S" & counter
           %>
           <tr><td colspan="2"><hr></td></tr> <tr><td align="right" nowrap><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 + 1 %>">Attribute Title: </td><td><input type="text" title="Attribute Title <%= counter %>" name="T<%= counter %>" value="<%= Request.Form(tempVar) %>" size="15" style="<%= C_FORMDESIGN %>" optional=true></td></tr>
           <%                Â
                            counter2 = 1
                            Do While Request.Form(tempVarName & counter2) <> "" 'Loop which gathers Attribute Options
           %>
           <tr><td align="right"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Option <%= counter2 %>: </td><td nowrap><input type="text" title="Option <%= tempVarName & counter2 %>" name="<%= tempVarName & counter2 %>" value="<%= Request.Form(tempVarName & counter2) %>" size="10" style="<%= C_FORMDESIGN %>" optional=true>
           <%
                                 choice = Request.Form(tempVarSet & counter2)
                                 choice0 = ""
                                 choice1 = ""
                                 choice2 = ""
                                 If choice = "0" Then
                                       choice0 = "checked"
                                 ElseIf choice = "1" Then
                                       choice1 = "checked"
                                 ElseIf choice = "2" Then
                                       choice2 = "checked"
                                 End If
           %>
                                       <font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
                                       <input type="radio" <%=choice0%> name="<%= tempVarSet & counter2 %>" value="0">Same Price
                                       <input type="radio" <%=choice1%> name="<%= tempVarSet & counter2 %>" value="1">Increase
                                       <input type="radio" <%=choice2%> name="<%= tempVarSet & counter2 %>" value="2">Decrease by:
           <%
                                Â
                                 If choice = "0" OR Request.Form(tempVarPrice & counter2) = "" Then
                                       tempVar3 = "0"
                                 Else
                                       tempVar3 = Request.Form(tempVarPrice & counter2)
                                 End If
           %>
                                 <input type="text" title="Option Price <%= counter2 %>" name="<%= tempVarPrice & counter2 %>" value="<%= tempVar3 %>" size="3" style="<%= C_FORMDESIGN %>" optional=true number=true></td></tr>
           <%
                                 counter2 = counter2 + 1
                            Loop
                            counter = counter + 1
                      Loop 'The Loops above only gather information already added
                      If addAttType = "Options"  and trim(Request.Form("T1")) <> "" Then 'If Statement addeds correct input field for new Option or Attribute Title
           %>
                            <tr><td align="right" nowrap><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"> Option <%= counter2 %>: </td>
                            <td nowrap><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
                            <input type="text" title="Option <%= counter2 %>" name="<%= tempVarName & counter2 %>" size="10" style="<%= C_FORMDESIGN %>" optional=true>
                            <input type="radio" checked name="<%= tempVarSet & counter2 %>" value="0">Same Price
                            <input type="radio" name="<%= tempVarSet & counter2 %>" value="1">Increase
                            <input type="radio" name="<%= tempVarSet & counter2 %>" value="2">Decrease by:
                            <input type="text" title="Option Price <%= counter2 %>" number=true name="<%= tempVarPrice & counter2 %>" size="3" style="<%= C_FORMDESIGN %>" optional=true value="0"></td></tr>
                            <tr><td align="center" colspan="2"><input type="submit" name="addAttType" value="Options"></td></tr>
                            <input type="hidden" name="attNumber" value="<%= counter-1 %>">
           <%
                      ElseIf addAttribute <> "" Then
           %>
                            <tr><td colspan="2"><hr></td></tr>
                            <tr><td align="right" noWrap><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Attribute Title: </td>
                            <td><input type="text" title="Attribute Title <%= counter %>"name="T<%=  counter %>" size="15" style="<%= C_FORMDESIGN %>"></tr></td>
                            <tr><td align="center" colspan="2">
                            <input type="submit" name="addAttType" value="Options"></td></tr> <input type="hidden" name="attNumber" value="<%= counter %>"> <%'JF%>
           <%
                      End If     Â
                 End If
           End If
           %>
           </table>
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" align="center" height="21"><input type="image" name="AddAttribute" border="0" src="images/addattr.gif" height="21"></td>
    </tr>
    <tr>
           <td colspan="2" height="19"> Â
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>" height="19"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    Images</font></b></td>
    </tr>
    <tr>
    <td width="50%" height="42"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Small Image<br>
     <input type="text" name="prodImageSmallPath" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    <td width="50%" height="42"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Large Image<br>
     <input type="text" name="prodImageLargePath" value="<%= prodImageLargePath%>" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
    <tr>
           <td colspan="2" height="19"> Â
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>" height="19"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    Sale Options</font></b></td>
    </tr>
    <tr>
    <%If Request.Form("prodSaleIsAc t") = "1" and Request.Form("addproduct.x ")="" Then 'checks the correct option%>
                 <td width="50%" height="42"><input type="checkbox" name="prodSaleIsAct" value="1" checked>
           <%Else%>
                 <td width="50%" height="42"><input type="checkbox" name="prodSaleIsAct" value="1">
           <%End If%>
           <font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Activate Sale </font></td>
    <td width="50%" height="42"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Sale Price<br>
     <input type="text" title="Product Sale Price" name="prodSalePrice" value="<%= prodSalePrice%>" size="20" style="<%= C_FORMDESIGN %>">
     </font></td>
    </tr>
    <tr>
           <td colspan="2" height="19"> Â
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>" height="19"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    Shipping Options</font></b></td>
    </tr>
    <tr>
    <%If Request.Form("prodShipIsAc t") = "1" and Request.Form("addproduct.x ")="" Then 'checks the correct option%>
                 <td width="50%" height="42"><input type="checkbox" name="prodShipIsAct" value="1" checked>
           <%Else%>
                 <td width="50%" height="42">
      <input type="checkbox" name="prodShipIsAct" value="1" checked>
           <%End If%>
           <font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Activate Shipping </font></td>
    <td width="50%" height="42"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Shipping Cost<br>
     <input type="text" title="Product Ship Price" name="prodShip" value="<%= prodShip%>" size="20" style="<%= C_FORMDESIGN %>">
     </font></td>
    </tr>
    <tr>
           <td colspan="2" height="19"> Â
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>" height="19"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    Tax Options</font></b></td>
    </tr>
    <tr>
    <%If Request.Form("prodStateTax IsAct") = "1" and Request.Form("addproduct.x ")="" Then'checks the correct option%>
                 <td width="50%" height="77"><input type="checkbox" name="prodStateTaxIsAct" value="1" checked>
           <%Else%>
                 <td width="50%" height="77"><input type="checkbox" name="prodStateTaxIsAct" value="1">
           <%End If%>
           <font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Activate State Tax</font></td>
    <%If Request.Form("prodCountryT axIsAct") = "1" and Request.Form("addproduct.x ")="" Then'checks the correct option%>
                 <td width="50%" height="77"><input type="checkbox" name="prodCountryTaxIsAct" value="1" checked>
           <%Else%>
                 <td width="50%" height="77"><input type="checkbox" name="prodCountryTaxIsAct" value="1">
           <%End If%>
           <font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Activate Country Tax</font></td>
    </tr>
    <tr>
           <td colspan="2" height="19"> Â
           </td>
           </tr>
    <tr>
           <td align="center" width="100%" colspan="2" height="21"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>"><input type="image" name="addproduct" src="images/addproduct.gif " border="0" WIDTH="108" HEIGHT="21" onClick="javascript:addPro ductClicke d();javasc ript:windo w.document .openerFor m.prodImag eSmallPath .optional= true;windo w.document .openerFor m.prodImag eLargePath .optional= true;windo w.document .openerFor m.prodLink .optional= true;windo w.document .openerFor m.prodShip .number=tr ue;window. document.o penerForm. prodSalePr ice.number =true;wind ow.documen t.openerFo rm.prodWei ght.number =true;wind ow.documen t.openerFo rm.prodPri ce.number= true;windo w.document .openerFor m.prodName Plural.opt ional=true ;window.do cument.ope nerForm.pr odMessage. optional=t rue;window .document. openerForm .prodWeigh t.optional =true;wind ow.documen t.openerFo rm.prodDes cription.o ptional=tr ue;window. document.o penerForm. prodSalePr ice.option al=true;wi ndow.docum ent.opener Form.prodC ategoryNew Id.optiona l=true;win dow.docume nt.openerF orm.prodMa nufacturer NewId.opti onal=true; window.doc ument.open erForm.pro dVendorNew Id.optiona l=true;ret urn addproductCheck(window.doc ument.open erForm)">< /td>
           </tr>
    </table><br>
  </td>
  </tr>
        <tr>
           <td bgcolor="<%= C_BGCOLOR7 %>" background="<%= C_BKGRND7 %>"><font face="<%= C_FONTFACE7 %>" color="<%= C_FONTCOLOR7 %>" size="<%= C_FONTSIZE7 %>"><p align="center"><b><a href="MT_MenuInv.asp">Stor e Inventory</a> | <a href="Menu.asp">Merchant Tools Home</a> | <a href="../../search.asp"><% = C_STORENAME %></a></b></font></p></td>
    </tr>
</table>
</td>
</tr>
</table>
</form>
<%'+JF 9/28/01%>
<script language="javascript" name=script2>
      if (window.document.openerFor m.prodCate goryId.opt ions[windo w.document .openerFor m.prodCate goryId.opt ions.selec tedIndex]. value == "New") {
                 window.document.openerForm .prodCateg oryNewId.d isabled = false
// Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â window.document.openerForm .prodCateg oryNewId.v alue = ""
           }
           else {
                 window.document.openerForm .prodCateg oryNewId.d isabled = true
                 window.document.openerForm .prodCateg oryNewId.v alue = "Select New Category"
           }
     Â
           if (window.document.openerFor m.prodManu facturerId .options[w indow.docu ment.opene rForm.prod Manufactur erId.optio ns.selecte dIndex].va lue == "New") {
                 window.document.openerForm .prodManuf acturerNew Id.disable d = false
// Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â window.document.openerForm .prodManuf acturerNew Id.value = ""
           }
           else {
                 window.document.openerForm .prodManuf acturerNew Id.disable d = true
                 window.document.openerForm .prodManuf acturerNew Id.value = "Select New Manufacturer"
           }
           if (window.document.openerFor m.prodVend orId.optio ns[window. document.o penerForm. prodVendor Id.options .selectedI ndex].valu e == "New") {
                 window.document.openerForm .prodVendo rNewId.dis abled = false
// Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â window.document.openerForm .prodVendo rNewId.val ue = ""
           }
           else {
                 window.document.openerForm .prodVendo rNewId.dis abled = true
                 window.document.openerForm .prodVendo rNewId.val ue = "Select New Vendor"
           }
     Â
</script>
<%'-JF 9/28/01%>
</body>
</html>
Here is the sfcheckerrors.js file which is called at the beginning:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------
sfcheckerrors.js
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------
//@BEGINVERSIONINFO
//@APPVERSION: 50.4013.0.2
//@FILENAME: sfcheckerrors.asp
     Â
//@DESCRIPTION: Checkes sfErrors
//@STARTCOPYRIGHT
//The contents of this file is protected under the United States
//copyright laws as an unpublished work, and is confidential and proprietary to
//LaGarde, Incorporated. Â Its use or disclosure in whole or in part without the
//expressed written permission of LaGarde, Incorporated is expressly prohibited.
//(c) Copyright 2000 by LaGarde, Incorporated. Â All rights reserved.
//@ENDCOPYRIGHT
//@ENDVERSIONINFO
function specialCase(e, form) {
      if ((e.name == "CardName")||(e.name == "CardNumber")||(e.name == "CardExpiryMonth")||(e.nam e == "CardExpiryYear")) {
           if (((form.CardName.value.len gth <= 0)||(form.CardNumber.value .length <= 0)||(form.CardExpiryMonth. value.leng th <= 0)||(form.CardExpiryYear.v alue.lengt h <= 0))
            && ((form.CardName.value.leng th > 0)||(form.CardNumber.value .length > 0)||(form.CardExpiryMonth. value.leng th > 0)||(form.CardExpiryYear.v alue.lengt h > 0))) {
                 return "Please enter all Credit Card Information.";
           }
           if ((form.CardName.value.leng th > 0)&&(form.CardNumber.value .length > 0)&&(form.CardExpiryMonth. value.leng th > 0)&&(form.CardExpiryYear.v alue.lengt h > 0)) {
                 if (!isCardDateValid(form.Car dExpiryYea r.value, form.CardExpiryMonth.value )) {
                      return "The Credit Card has Expired.";
                 }
                 if (isCardNumValid(form.CardN umber.valu e)) {
                      return "The Credit Card Number is an invalid format.";
                 }
           }
      }
      if ((e.name == "CheckNumber")||(e.name == "BankName")||(e.name == "RoutingNumber")||(e.name == "CheckingAccountNumber")) {
           if (((form.CheckNumber.value. length <= 0)||(form.BankName.value.l ength <= 0)||(form.RoutingNumber.va lue.length <= 0)||(form.CheckingAccountN umber.valu e.length <= 0))
            && ((form.CheckNumber.value.l ength > 0)||(form.BankName.value.l ength > 0)||(form.RoutingNumber.va lue.length > 0)||(form.CheckingAccountN umber.valu e.length > 0))) {
                 return "Please enter all eCheck Information.";
           }           Â
      }
      if ((e.name == "POName")||(e.name == "PONumber")) {
          Â
           if (((form.POName.value.lengt h <= 0)||(form.PONumber.value.l ength <= 0))
            && ((form.POName.value.length > 0)||(form.PONumber.value.l ength > 0))) {
                 return "Please enter all Purchase Order Information.";
           }
      }
      if ((form.CardName.value.leng th <= 0)&&(form.CardNumber.value .length <= 0)&&(form.CardExpiryMonth. value.leng th <= 0)&&(form.CardExpiryYear.v alue.lengt h <= 0)
      && (form.CheckNumber.value.le ngth <= 0)&&(form.BankName.value.l ength <= 0)&&(form.RoutingNumber.va lue.length <= 0)&&(form.CheckingAccountN umber.valu e.length <= 0)
      && (form.POName.value.length <= 0)&&(form.PONumber.value.l ength <= 0)) {
           return "Please enter payment method Information.";     Â
      }
      return "";
}
function stripChar(sValue, sChar) {
      var i, tempChar, buildString;
      buildString = ""
      for (var i=0; i<sValue.length; i++) {
           tempChar = sValue.charAt(i);
           if (tempChar != sChar) {
                 buildString = buildString + tempChar;
           }
      }
      return buildString;
}
function isCardDateValid(year, month) {
      var dateCheck, now;
      if (year.length == 2) {
           if (parseInt(year) < 50) {
                 year = "20" + year;
           }
      }
      now = new Date();
      dateCheck = new Date(year, month);
      if (now > dateCheck) {
           return false;
      }
      else {
           return true;
      }
}
function isCardNumValid(num) {
      var num1, num2, tempNum;
      if (!isNumber(num)) {
           return true;
      }
      num1 = ""
      if (!(num.length%2==0)) {
           for(var j=0; j < num.length; j++) {
                 if ((j+1)%2==0){
                      tempNum = 2 * num.charAt(j);
                 }
                 else {
                      tempNum = 1 * num.charAt(j);
                 }
                 num1 = num1 + tempNum.toString();
           }
      }
      else{
           for(var j=0; j < num.length; j++){
                 if ((j+1)%2==0){
                      tempNum = 1 * num.charAt(j);
                 }
                 else{
                      tempNum = 2 * num.charAt(j);
                 }
                 num1 = num1 + tempNum.toString();
           }
      }
      num2 = 0;
      for (var j = 0; j < num1.length; j++) {
           num2 = num2 + parseInt(num1.charAt(j));
      }
      if (num2%10==0) {
           return false;
      }
      else {
           return true;
      }
}
function isNumber(value) {
      for (var i=0; i < value.length; i++) {
           a = parseInt(value.charAt(i));
           if (isNaN(a)) {
                 return false;                Â
                 break;
           }
      }
      return true;
}
function sfCheck(form) {
      var e, title, empty_fields, char_check, invalid_card, month, year, invalid_date, eMail, invalid_eMail
      var iQuantity, quantity_check, checkSpecial, tempError, special_Error, msg, upperLine, lowerLine
      var num, invalid_phoneNumber, passwd_mismatch
      msg = "";
      empty_fields = "";
      char_check = "";
      special_Error = "";
      tempError = "";
      num = form.length
      for (var i = 0; i < form.length; i++) {
           e = form.elements[i]
           if ((e.title == null)||(e.title == "")) {
                 title = e.name;
           }
           else {
                 title = e.title;
           }
           if (((e.type == "text") || (e.type == "textarea")||(e.type == "password")) && !e.special && !e.disabled) {
                 if (e.value.length <= 0 && !e.optional && (e.name.indexOf("Ship") == -1)) {
                      empty_fields += "\n       " + title;
                      continue;
                 }
                 if (e.number) {
                      num = e.value;
                      num = stripChar(num, ".");
                      num = stripChar(num, ",");
                      if (!isNumber(num)) {
                            char_check += "\n       " + title;
                      }
                 }
                 if (e.creditCardNumber) {
                      e.value = stripChar(e.value, " ");
                      e.value = stripChar(e.value, "-");
                      invalid_card = isCardNumValid(e.value);
                 }
                Â
                 if ((e.creditCardExpMonth)||( e.creditCa rdExpYear) ) {
                      if (e.creditCardExpMonth) {
                            month = e.value;
                            month = stripChar(month, " ")
                            if (!isNumber(month)) {
                                 invalid_date = true;
                                 month = null;
                            }
                      }
                      if (e.creditCardExpYear) {
                            year = e.value;
                            year = stripChar(year, " ")
                            if (!isNumber(year)) {
                                 invalid_date = true;
                                 year = null;
                            }
                      }
                      if ((month != null) && (year != null)) {
                            if(!isCardDateValid(year, month)) {
                                 invalid_date = true;
                            }     Â
                      }
                 }
                 if (e.eMail) {
                      eMail = e.value;
                      if ((eMail.indexOf("@") != -1) && (eMail.indexOf(".") != -1)) {
                            invalid_eMail = false;
                      }
                      else {
                            invalid_eMail = true;
                      }
                 }
            if (e.name == "txtEmail") {
                      eMail = e.value;
                      if ((eMail.indexOf("@") != -1) && (eMail.indexOf(".") != -1)) {
                            invalid_eMail = false;
                      }
                      else {
                      Â
                            invalid_eMail = true;
                      }
                 }     Â
                 if (e.name == "txtFriend") {
                      eMail = e.value;
                      if ((eMail.indexOf("@") != -1) && (eMail.indexOf(".") != -1)) {
                            invalid_eMail = false;
                      }
                      else {
                      Â
                            invalid_eMail = true;
                      }
                 }     Â
                 if (e.phoneNumber) {
                      num = e.value;
                      num = stripChar(num, " ");
                      num = stripChar(num, "-");
                      num = stripChar(num, "+");
                      if (num.length < 10) {
                            invalid_phoneNumber = true;
                      }     Â
                 }
           }
           if (e.quantityBox) {
                 iQuantity = e.value;
                 if (!isNumber(iQuantity)) {
                      quantity_check = true;
                 }
                 if (parseInt(iQuantity) < 0) {
                      quantity_check = true;
                 }
                 if ((iQuantity) < 1) {
                      quantity_check = true;
                 }
           }
           if (e.password) {
                 if (form.Password.value != form.Password2.value) {
                            passwd_mismatch = true;
                 }
           }
           if (e.special) {
                 checkSpecial = specialCase(e, form);
                 if (tempError != checkSpecial) {
                      special_Error = special_Error + checkSpecial
                 }
                 tempError = checkSpecial;
           }
           if (e.type == "select-one" && !e.optional) {
                 if (e.value == "") {
                      empty_fields += "\n       " + title;
                      continue;
                 }
           }
      }
     Â
      if (!empty_fields && !char_check && !special_Error && !invalid_card && !invalid_date && !invalid_eMail && !quantity_check && !invalid_phoneNumber && !passwd_mismatch) {return true}
     Â
      msg = "The form was not submited due to the following error(s).\n";
     Â
      upperLine = "\n_______________________ __________ __________ __________ ____\n\n";
      lowerLine = "_________________________ __________ __________ __________ __\n";
     Â
      if (empty_fields) {
           msg += upperLine;
           msg += "The following field(s) must be filled in:\n";
           msg += lowerLine;
           msg += empty_fields;
      }
      if (char_check) {
           msg += upperLine;
           msg += "The following field(s) need a numeric value:\n";
           msg += lowerLine;
           msg += char_check;
      }
      if (quantity_check) {
           msg += upperLine;
           msg += "Please Enter a Positive Integer.\n"
           msg += lowerLine;
      }
      if (invalid_card) {
           msg += upperLine;
           msg += "The Credit Card Number is an invalid format.\n";
           msg += lowerLine;
      }
      if (invalid_date) {
           msg += upperLine;
           msg += "The Credit Card has Expired.\n";
           msg += lowerLine;
      }
      if (invalid_eMail) {
           msg += upperLine;
           msg += "The Email Address is in an invalid format.\n";
           msg += lowerLine;
      }
      if (invalid_phoneNumber) {
           msg += upperLine;
           msg += "Please enter a valid Phone Number with area code.\n";
           msg += lowerLine;
      }
      if (special_Error) {
           msg += upperLine;
           msg += special_Error + "\n";
           msg += lowerLine;
      }
      if (passwd_mismatch) {
           msg += upperLine;
           msg += "Your passwords did not match. Please enter them again.\n";
           msg += lowerLine;
      }           Â
      alert(msg);
      return false;
} Â Â Â Â Â
function sfCheckPlus(frm) {
     Â
      if (window.document.form1.Shi pFirstName .value != "" || window.document.form1.Ship MiddleInit ial.value != "" || window.document.form1.Ship LastName.v alue != "" || window.document.form1.Ship Company.va lue != "" || window.document.form1.Ship Address1.v alue != "" || window.document.form1.Ship Address2.v alue != "" || window.document.form1.Ship City.value != "" || window.document.form1.Ship State.valu e != "" || window.document.form1.Ship Zip.value != "" || window.document.form1.Ship Country.va lue != "" || window.document.form1.Ship Phone.valu e != "" || window.document.form1.Ship Email.valu e != "" || window.document.form1.Ship Fax.value != "")                 Â
      {
      if (window.document.form1.Shi pFirstName .value == "" || window.document.form1.Ship LastName.v alue == "" || window.document.form1.Ship Address1.v alue == "" || window.document.form1.Ship City.value == "" || window.document.form1.Ship State.valu e == "" || window.document.form1.Ship Zip.value == "" || window.document.form1.Ship Country.va lue == "" || window.document.form1.Ship Phone.valu e == "" || window.document.form1.Ship Email.valu e == "")                 Â
      {
      window.alert("Please either fill in all shipping info or no shipping info.")
      return false
      }
      else
      {return sfCheck(frm)}
      }            Â
}
function POCheck(poname,poNum)
{
 if(poname == "" || poNum == "")
  {
  alert("Please Enter the required purchase order information");
  Â
  return false;
  }
  else
  {
   return true;
  }
}
Thanks.
--------------------------
[mt_addproduct.asp]
--------------------------
<%
      Option Explicit
      Response.Buffer=True   Â
  Const vDebug = 0
  '-------------------------
'@BEGINVERSIONINFO
'@APPVERSION: 50.1003.0.1
'@FILENAME: MT_AddProduct.asp
     Â
'@FILEVERSION: 1.0.1
'@VERSIONDATETIME: 2/21/01
'@DESCRIPTION: Â web Admin tool
'@STARTCOPYRIGHT
'The contents of this file is protected under the United States
'copyright laws and is confidential and proprietary to
'LaGarde, Incorporated. Â Its use or disclosure in whole or in part without the
'expressed written permission of LaGarde, Incorporated is expressly prohibited.
'
'(c) Copyright 2000, 2001 by LaGarde, Incorporated. Â All rights reserved.
'@ENDCOPYRIGHT
'@ENDVERSIONINFO Â Â Â Â Â
%>
`<SCRIPT language="javascript" src="../../SFLib/sfCheckEr
<SCRIPT language="javascript">
      var bAddProduct
      bAddProduct = false
      function newCategory() {
           if (window.document.openerFor
                 window.document.openerForm
                 window.document.openerForm
           }
           else {
                 window.document.openerForm
                 window.document.openerForm
           }     Â
      }
      function newMFG() {
           if (window.document.openerFor
                 window.document.openerForm
                 window.document.openerForm
           }
           else {
                 window.document.openerForm
                 window.document.openerForm
           }     Â
      }
      function newVendor() {
           if (window.document.openerFor
                 window.document.openerForm
                 window.document.openerForm
           }
           else {
                 window.document.openerForm
                 window.document.openerForm
           }     Â
      }
      function addproductCheck(form) {
      var sMes
           sMes=""
           var sExists
           var cnt           Â
          Â
           if (window.document.openerFor
                      cnt=0
                 sExists=""
                 do
                 {
                 if (window.document.openerFor
                 {sExists="1"}
                 cnt+=1;
                 } while(cnt<window.document.
                 if (sExists =="1"){
                      sMes=sMes+"Please fill in a unique category name.\n";
                      }
                 if (window.document.openerFor
                      sMes=sMes+"Please fill in new category name.\n";
                      }}
           if (window.document.openerFor
                                 cnt=0
                 sExists=""
                 do
                 {
                 if (window.document.openerFor
                 {sExists="1"}
                 cnt+=1;
                 } while(cnt<window.document.
                 if (sExists =="1"){
                      sMes=sMes+"Please fill in a unique manufacturer name.\n";
                      }
                 if (window.document.openerFor
                      sMes=sMes+"Please fill in a new manufacturer name.\n";
                      }}
           if (window.document.openerFor
                            cnt=0
                 sExists=""
                 do
                 {
                 if (window.document.openerFor
                 {sExists="1"}
                 cnt+=1;
                 } while(cnt<window.document.
                 if (sExists =="1"){
                      sMes=sMes+"Please fill in a unique vendor name.\n";
                      }
     Â
                 if (window.document.openerFor
                      sMes=sMes+"Please fill in new vendor name.\n"
                      }}
           if (sMes != "")      {
                 alert(sMes);
                 return false
                 }
          Â
var sName                      Â
           sName=window.document.open
          Â
           if (bAddProduct) {
                 if (sName.indexOf("'",0) >= 0){
                      window.alert("Product Name can not contain apostrophes.\n");
                      return false
                      }
                 else
                 {     Â
                 if (sfCheck(form)) {
                      return true;
                 }
                 else {
                      bAddProduct = false;
                      return false;
                 }}
           }
           else {
                 return true;
           }
      }
      function addProductClicked() {
           bAddProduct = true
      }
</SCRIPT>
<!--#include file="../SFLib/db.conn.ope
<!--#include file="../SfLib/incGeneral.
<!--#include file="../SFLib/ADOVBS.inc"
<!--#include file="MT_incadmin.asp"-->
<!--#include file="../SFLib/incDesign.a
<html>
<head>
<title>StoreFront Merchant Tools</title>
<SCRIPT language="javascript">
function helpMe(){
      var helpWin, loadHelp
      helpWin = window.open('help/prod_2.h
      helpWin.focus()
} Â Â Â Â Â
</SCRIPT>
</head>
<%
dim prodID, prodCategoryId, prodManufacturerId, prodVendorId, prodName, prodDescription, prodMessage
dim prodImageSmallPath, prodImageLargePath, prodLink, prodLink1, prodLink2, prodLink3, prodLink4, prodPrice, prodWeight, prodShip, Output, choice0, choice1, choice2, choice
dim prodShipIsAct, prodCountryTaxIsAct, prodStateTaxIsAct, prodEnabledIsAct, addAttribute, attNumber
dim addAttType, attNumDetail, rsProdInput, rsProdAttGet, counter, tempVar, tempVarName, tempVarPrice
dim tempVarSet, counter2, tempVar3, SQL, tempPrice, prodSalePrice, prodSaleIsAct, prodShortDescription, prodNamePlural, selected
dim Cvalue, Mvalue, Vvalue, rsNewCat, rsNewMFG, rsNewVen, iBookMark
dim prodCategoryNewId, prodManufacturerNewId, prodVendorNewId
dim prodLength,prodHeight,prod
'The page is devided into two area, confirmation area, and gathering input area
'Request all inputs           Â
prodID = Â Â Â Â Â Â Â Trim(Request.Form("prodID"
prodCategoryId = Â Â Â Trim(Request.Form("prodCat
prodManufacturerId = Â Trim(Request.Form("prodMan
prodVendorId = Â Â Â Â Trim(Request.Form("prodVen
prodCategoryNewId = Â Â Â Trim(Request.Form("prodCat
prodManufacturerNewId = Â Trim(Request.Form("prodMan
prodVendorNewId = Â Â Â Â Trim(Request.Form("prodVen
prodName = Â Â Â Â Â Â Trim(Request.Form("prodNam
prodNamePlural = Â Â Â Trim(Request.Form("prodNam
prodDescription = Â Â Trim(Request.Form("prodDes
prodShortDescription =Trim(Request.Form("prodSh
prodMessage = Â Â Â Â Trim(Request.Form("prodMes
prodImageSmallPath = Â Trim(Request.Form("prodIma
prodImageLargePath = Â Trim(Request.Form("prodIma
prodLink = Â Â Â Â Â Â Trim(Request.Form("prodLin
prodLink1 = Â Â Â Â Â Â Trim(Request.Form("prodLin
prodLink2 = Â Â Â Â Â Â Trim(Request.Form("prodLin
prodLink3 = Â Â Â Â Â Â Trim(Request.Form("prodLin
prodLink4 = Â Â Â Â Â Â Trim(Request.Form("prodLin
prodPrice = Â Â Â Â Â Trim(Request.Form("prodPri
prodWeight = Â Â Â Â Â Trim(Request.Form("prodWei
if trim(prodWeight)="" then
prodWeight = Â Â Â Â Â 0
end if
      prodHeight =      Trim(Request.Form("prodHei
      if trim(prodHeight)="" then
           prodHeight =      0
      end if
      prodWidth =      Trim(Request.Form("prodWid
      if trim(prodWidth)="" then
           prodWidth =      0
      end if
      prodLength =      Trim(Request.Form("prodLen
      if trim(prodLength)="" then
           prodLength =      0
      end if
prodSalePrice = Â Â Â Trim(Request.Form("prodSal
prodSaleIsAct = Â Â Â Trim(Request.Form("prodSal
prodShip = Â Â Â Â Â Â Trim(Request.Form("prodShi
prodShipIsAct = Â Â Â Trim(Request.Form("prodShi
prodCountryTaxIsAct = Trim(Request.Form("prodCou
prodStateTaxIsAct = Â Trim(Request.Form("prodSta
prodEnabledIsAct = Â Â Trim(Request.Form("prodEna
addAttribute = Â Â Â Â Trim(Request.Form("addAttr
attNumber = Â Â Â Â Â Trim(Request.Form("attNumb
addAttType = Â Â Â Â Â Trim(Request.Form("addAttT
attNumDetail = Â Â Â Â Â Â Â Â Â Trim(Request.Form("attNumD
      'correct null data
      If prodShipIsAct="" Then
           prodShipIsAct= 0
      End If
     Â
      If prodCountryTaxIsAct="" Then
           prodCountryTaxIsAct= 0
      End If
      If prodStateTaxIsAct="" Then
           prodStateTaxIsAct= 0
      End If
      If prodEnabledIsAct="" Then
           prodEnabledIsAct= 0
      End If     Â
     Â
      If prodSaleIsAct="" Then
           prodSaleIsAct= 0
      End If     Â
'Confirmation and database insert area
If Request.Form("addproduct.x
      If prodShip = "" Then prodShip = 0
      If prodSalePrice = "" Then prodSalePrice = 0
      If attNumber = "" Then attNumber = 0     Â
      If prodCategoryId = "New" Then
           Set rsNewCat = Server.CreateObject("ADODB
           rsNewCat.CursorLocation = adUseClient
           rsNewCat.Open "sfCategories Order By catID", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
           rsNewCat.AddNew
           rsNewCat.Fields("catName")
           rsNewCat.Update
          Â
           iBookMark = rsNewCat.AbsolutePosition
           rsNewCat.Requery
           rsNewCat.AbsolutePosition = iBookMark
          Â
           prodCategoryId = rsNewCat.Fields("catID")           Â
           rsNewCat.Close
           Set rsNewCat = nothing
      End If
     Â
      If prodManufacturerId = "New" Then
           Set rsNewMFG = Server.CreateObject("ADODB
           rsNewMFG.CursorLocation = adUseClient
           rsNewMFG.Open "sfManufacturers Order By mfgID", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
           rsNewMFG.AddNew
           rsNewMFG.Fields("mfgName")
           rsNewMFG.Update
          Â
           iBookMark = rsNewMFG.AbsolutePosition
           rsNewMFG.Requery
           rsNewMFG.AbsolutePosition = iBookMark
          Â
           prodManufacturerId = rsNewMFG.Fields("mfgID")
           rsNewMFG.Close
           Set rsNewMFG = nothing
      End If
     Â
      If prodVendorId = "New" Then
           Set rsNewVen = Server.CreateObject("ADODB
           rsNewVen.CursorLocation = adUseClient
           rsNewVen.Open "sfVendors Order By vendID", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
           rsNewVen.AddNew
           rsNewVen.Fields("vendName"
           rsNewVen.Update
          Â
           iBookMark = rsNewVen.AbsolutePosition
           rsNewVen.Requery
           rsNewVen.AbsolutePosition = iBookMark
          Â
           prodVendorId = rsNewVen.Fields("vendID")
           rsNewVen.Close
           Set rsNewVen = nothing
      End If
     Â
      'Input information into the database
      Set rsProdInput = Server.CreateObject("ADODB
      rsProdInput.Open "sfProducts", cnn, adOpenDynamic, adLockOptimistic, adCmdTable
     Â
      On Error Resume Next
      rsProdInput.AddNew
      rsProdInput.Fields("prodID
      rsProdInput.Fields("prodCa
      rsProdInput.Fields("prodMa
      rsProdInput.Fields("prodVe
      rsProdInput.Fields("prodNa
      rsProdInput.Fields("prodNa
      rsProdInput.Fields("prodDe
      rsProdInput.Fields("prodSh
      rsProdInput.Fields("prodMe
      rsProdInput.Fields("prodIm
      rsProdInput.Fields("prodIm
     Â
      rsProdInput.Fields("prodLi
      rsProdInput.Fields("prodLi
      rsProdInput.Fields("prodLi
      rsProdInput.Fields("prodLi
      rsProdInput.Fields("prodLi
                           Â
      rsProdInput.Fields("prodPr
      rsProdInput.Fields("prodWe
      rsProdInput.Fields("prodHe
      rsProdInput.Fields("prodLe
      rsProdInput.Fields("prodWi
      rsProdInput.Fields("prodSa
      rsProdInput.Fields("prodSa
      rsProdInput.Fields("prodSh
      rsProdInput.Fields("prodSh
      rsProdInput.Fields("prodCo
      rsProdInput.Fields("prodSt
      rsProdInput.Fields("prodEn
' Â Â Â Â Â rsProdInput.Fields("prodAt
      rsProdInput.Fields("prodDa
      rsProdInput.Update
      rsProdInput.Close
                Â
      rsProdInput.Open "sfAttributes", cnn, adOpenDynamic, adLockOptimistic, adCmdTable
     Â
      'Input Attribute Headers
      If Err.number = 0 Then
           counter = 1
           Do While Request.Form("T" & counter) <> ""
                 tempVar = "T" & counter
                 if trim(Request.Form(tempVar)
                 rsProdInput.AddNew
                 rsProdInput.Fields("attrPr
                 rsProdInput.Fields("attrNa
                 rsProdInput.Update
                 end if
                 counter = counter + 1
           Loop
     Â
'+JF 9/27/01
           attNumber=counter-1
           rsProdInput.Close
     Â
      Set rsProdInput = Server.CreateObject("ADODB
      SQL = "SELECT * FROM sfProducts WHERE prodID = '" & prodID & "'"
      rsProdInput.Open SQL, cnn, adOpenDynamic, adLockOptimistic, adCmdText
      'Input base product information
      rsProdInput.Fields("prodAt
      rsProdInput.update
      rsProdInput.close
'-JF 9/27/01 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
           SQL = "SELECT attrID, attrName FROM sfAttributes WHERE attrProdId = '" & prodID & "'"
           Set rsProdAttGet = Server.CreateObject("ADODB
           rsProdAttGet.Open SQL, cnn, adOpenForwardOnly, adLockOptimistic, adCmdText
     Â
           rsProdInput.Open "sfAttributeDetail", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
     Â
           'Input Attribute Details
           counter = 1
           Do While Not rsProdAttGet.EOF
                 tempVar = "T" & counter
                 tempVarName = "N" & counter
                 tempVarPrice = "P" & counter
                 tempVarSet = "S" & counter
                 If Request.Form(tempVar) = rsProdAttGet.Fields("attrN
                      counter2 = 1
                      Do While Request.Form(tempVarName & counter2) <> ""
                            if trim(Request.Form(tempVarN
                            rsProdInput.AddNew
                            rsProdInput.Fields("attrdt
                            rsProdInput.Fields("attrdt
                            tempPrice = Request.Form(tempVarPrice & counter2)
                            If tempPrice = "" or isnull(tempPrice) Then
                                 rsProdInput.Fields("attrdt
                            Else
                                 rsProdInput.Fields("attrdt
                            End If
                            rsProdInput.Fields("attrdt
                            rsProdInput.Update
                            end if
                            counter2 = counter2 + 1
                      Loop
                      rsProdAttGet.MoveNext
                      counter = 1
                 Else
                      counter = counter + 1
                 End If
           Loop     Â
     Â
           rsProdInput.Close
           rsProdAttGet.Close
     Â
           Set rsProdInput = nothing
           Set rsProdAttGet = nothing
      End If
prodID = Â Â Â Â Â Â Â ""
prodCategoryId = Â Â Â ""
prodManufacturerId = Â ""
prodVendorId = Â Â Â Â ""
prodCategoryNewId = Â Â Â ""
prodManufacturerNewId = Â ""
prodVendorNewId = Â Â Â Â ""
prodName = Â Â Â Â Â Â ""
prodNamePlural = Â Â Â ""
prodDescription = Â Â ""
prodShortDescription =""
prodMessage = Â Â Â Â ""
prodImageSmallPath = Â ""
prodImageLargePath = Â ""
prodLink = Â Â Â Â Â Â ""
prodLink1 = Â Â Â Â Â Â ""
prodLink2 = Â Â Â Â Â Â ""
prodLink3 = Â Â Â Â Â Â ""
prodLink4 = Â Â Â Â Â Â ""
prodPrice = Â Â Â Â Â ""
prodWeight = Â Â Â Â Â "0"
prodHeight = Â Â Â Â Â "0"
prodLength = Â Â Â Â Â "0"
prodWidth = Â Â Â Â Â "0"
prodSalePrice = Â Â Â ""
prodSaleIsAct = Â Â Â ""
prodShip = Â Â Â Â Â Â ""
prodShipIsAct = Â Â Â ""
prodCountryTaxIsAct = ""
prodStateTaxIsAct = Â ""
prodEnabledIsAct = Â Â ""
addAttribute = Â Â Â Â ""
attNumber = Â Â Â Â Â ""
addAttType = Â Â Â Â Â ""
attNumDetail = Â Â Â Â Â Â Â Â Â "" Â Â Â Â Â
End If
%> Â Â Â Â Â
<body background="<%= C_BKGRND %>" bgproperties="fixed" bgcolor="<%= C_BGCOLOR %>" link="<%= C_LINK %>" vlink="<%= C_VLINK %>" alink="<%= C_ALINK %>" onLoad="javascript:newCate
<form method="post" name="openerForm" id="openerForm" onSubmit=""><%'JF 9/27/01%>
<table border="0" cellpadding="1" cellspacing="0" bgcolor="<%= C_BORDERCOLOR1 %>" width="<%= C_WIDTH %>" align="center">
<tr>
<td>
  <table width="100%" border="0" cellspacing="1" cellpadding="3">
  <tr>
<% Â Â Â Â Â If C_BNRBKGRND = ""Â Then %>
<% Â Â Â Â Â Else %>
<% Â Â Â Â Â End If %> Â Â Â
  </tr>
  <tr>
      <td align="middle" background="<%= C_BKGRND2 %>" bgcolor="<%= C_BGCOLOR2 %>">
  <b><font face="Tahoma" color="#FFFFFF" size="4">Blue Vinyl</font><font face="<%= C_FONTFACE2 %>" color="<%= C_FONTCOLOR2 %>" SIZE="<%= C_FONTSIZE2 %>"> Merchant Tools</font></b></td>    Â
  </tr>
      <tr>
      <td bgcolor="<%= C_BGCOLOR3 %>" background="<%= C_BKGRND3 %>" width="100%" >Â
     Â
            <table border="0" width="100%">
    <tr>
    <td width="83%"><b>
    <font face="<%= C_FONTFACE3 %>" color="<%= C_FONTCOLOR3 %>" SIZE="<%= C_FONTSIZE3+1 %>">Store Inventory: Add A Product</font></b>
    <td width="17%" align="right">
    <A HREF="javascript:helpMe()"
    </tr>
    </table>
 Â
       <tr>
      <td bgcolor="<%= C_BGCOLOR4 %>" background="<%= C_BKGRND4 %>" width="100%">
 Â
<%
If Err.number <>Â 0 Then
'If Err.number = 3705 Then
%>
     Â
                      <table cellpadding="5" cellspacing="0" bgcolor="<%= C_BGCOLOR4 %>" width="100%">
                      <tr><td width="100%" bgcolor="<%= C_BGCOLOR4 %>" align="center" background="<%= C_BKGRND5 %>">
                      <b><font face="<%= C_FONTFACE5 %>" color="#FF0000" size="<%= C_FONTSIZE5+2 %>"><b>Database Error
                      </font></b>
                      <br>
                      <b><font face="<%= C_FONTFACE5 %>" color="#FF0000" size="<%= C_FONTSIZE5 %>">Error Number= <%= Err.number%><br>Error Description= <%= Err.description %>
                      </td></tr>
                      </table>
<%
'End If
End If
If Request.Form("addproduct.x
%>
                      <table cellpadding="5" cellspacing="0" bgcolor="<%= C_BGCOLOR4 %>" width="100%">
                      <tr><td width="100%" bgcolor="<%= C_BGCOLOR4 %>" align="center" background="<%= C_BKGRND5 %>">
                      <b><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4+2 %>"><b>Database Updated
                      </font>
                      <br><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"><a href="Menu.asp">Return to Merchant Tools</b></a>
                      </font></b>
                      </td></tr>
                      </table>
<%End If%>
 Â
    <table width="100%">
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>" height="19"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    General Product Information</font></b></td
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product ID:</font></td>
    <td width="50%" height="22">
    <input type="text" name="prodID" title="Product ID" size="20" style="<%= C_FORMDESIGN %>" value="RCD"></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Name:</font></td>
    <td width="50%" height="22"><input type="text" name="prodName" title="Product Name" value="<%= prodName %>" size="20" style="<%= C_FORMDESIGN %>"></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Name Plural:</font></td>
    <td width="50%" height="22"><input type="text" name="prodNamePlural" title="Product Name Plural" value="<%= prodNamePlural %>" size="20" style="<%= C_FORMDESIGN %>"></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product
    Label:</font></td>
    <td width="50%" height="22"><select size="1" name="prodCategoryId" style="<%= C_FORMDESIGN %>" onChange="javascript:newCa
    <%
    If prodCategoryId <> "New" Then
                 Response.write getCategoryList(prodCatego
                 selected = ""
           Else
                 Response.write getCategoryList(0)
                 selected = "selected"
                 Cvalue= Request.Form("prodCategory
           End If
    %><option <%= selected %> value="New">New Label</select><input type="text" name="prodCategoryNewId" value="<%= Cvalue %>" style="<%= C_FORMDESIGN %>" size=18></input></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product
     Category:</font></td>
    <td width="50%" height="22"><select size="1" name="prodManufacturerId" style="<%= C_FORMDESIGN %>" onChange="javascript:newMF
    <%
    If prodManufacturerId <> "New" Then
      Response.write getManufacturersList(prodM
      selected = ""
    Else
                 Response.Write getManufacturersList(0)
                 selected = "selected"
                 Mvalue = Request.Form("prodManufact
           End If
    %><option <%= selected %> value="New">New Category</select><input type="text" name="prodManufacturerNewI
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" height="22"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product
     Vendor:</font></td>
    <td width="50%" height="22"><select size="1" name="prodVendorId" style="<%= C_FORMDESIGN %>" onChange="javascript:newVe
    <%
    If prodVendorId <> "New" Then
      Response.write getVendorList(prodVendorId
      selected = ""
    Else
                 Response.Write getVendorList(0)
                 selected = "selected"
                 Vvalue = Request.Form("prodVendorNe
           End If
    %><option <%= selected %> value="New">New Vendor</select><input type="text" name="prodVendorNewId" value="<%= Vvalue %>" style="<%= C_FORMDESIGN %>" size=18></input></td>
     </select>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Price:</font></td>
    <td width="50%" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"><input type="text" name="prodPrice" title="Product Price" value="<%= prodPrice%>" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" valign="top" nowrap height="36"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Short Description :<br><font size="-1">(used on search.asp)</font></td>
    <td width="50%" height="36"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"><textarea rows="2" name="prodShortDescription
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" valign="top" height="68"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Long Description :<br><font size="-1">(used on detail.asp)</font></font><
    <td width="50%" height="68"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"><textarea rows="4" name="prodDescription" cols="30" style="<%= C_FORMDESIGN %>"><%= prodDescription %></textarea>
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Confirmation Message:</font></td>
    <td width="50%" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"><input type="text" name="prodMessage" title="Product Message" value="<%= prodMessage%>" size="30" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right" height="7" valign="top"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Link:</font></td>
    <td width="50%" height="7"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodLink" size="30" style="<%= C_FORMDESIGN %>" value="<%= prodLink%>">
    </font>
           </td>
    </tr>
    <tr>
    <td width="50%" align="right" height="4" valign="top"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Link1:</font></td>
    <td width="50%" height="4"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodLink1" size="30" style="<%= C_FORMDESIGN %>" value="<%= prodLink1%>"></font></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="4" valign="top"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Link2:</font></td>
    <td width="50%" height="4"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodLink2" size="30" style="<%= C_FORMDESIGN %>" value="<%= prodLink2%>"></font></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="4" valign="top"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Link3:</font></td>
    <td width="50%" height="4"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodLink3" size="30" style="<%= C_FORMDESIGN %>" value="<%= prodLink3%>"></font></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="4" valign="top"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Link4:</font></td>
    <td width="50%" height="4"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodLink4" size="30" style="<%= C_FORMDESIGN %>" value="<%= prodLink4%>"></font></td>
    </tr>
    <tr>
    <td width="50%" align="right" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Weight:</font></td>
    <td width="50%" height="23"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
    <input type="text" name="prodWeight" title="Product Weight" size="20" style="<%= C_FORMDESIGN %>" value="0.">
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Length:</font></td>
    <td width="50%"><font face="Verdana" size="2"><input type="text" title="Product Length" name="prodLength" value="<%= prodLength%>" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Width:</font></td>
    <td width="50%"><font face="Verdana" size="2"><input type="text" title="Product Width" name="prodWidth" value="<%= prodWidth%>" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
    <tr>
    <td width="50%" align="right"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Height:</font></td>
    <td width="50%"><font face="Verdana" size="2"><input type="text" title="Product Height" name="prodHeight" value="<%= prodHeight%>" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
   Â
    <tr>
    <td width="50%" align="right" height="20"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Activate Product:</font></td>
    <%If Request.Form("prodEnabledI
           <td width="50%" height="20">
    <input type="checkbox" name="prodEnabledIsAct" value="1" checked></td>
           <%Else%>
           <td width="50%" height="20"><input type="checkbox" name="prodEnabledIsAct" value="1" checked></td>
           <%End If%>
    </tr>
    <tr>
           <td colspan="2"> Â
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    Attributes</font></b></td>
    </tr>
    <tr>
    <td width="100%" colspan="2">
    <table width="100%" border="0">
    <%
           'Gathers Attribute information and displayes in correct HTML format
           addAttribute = Request.Form("AddAttribute
           If addAttribute <> "" or addAttType = "Options" or Request.Form("actionType")
                 If attNumber = "" and Request.Form("actionType")
           %>
           <tr><td colspan="2"><hr></td></tr>
           <tr><td align="center" colspan="2"><input type="submit" name="addAttType" value="Options"></td></tr>
           <%           Â
                 Else
                      counter = 1
                      Do While Request.Form("T" & counter) <> "" 'Loop which gathers Attribute Titles already added
                            tempVar = "T" & counter
                            tempVarName = "N" & counter
                            tempVarPrice = "P" & counter
                            tempVarSet = "S" & counter
           %>
           <tr><td colspan="2"><hr></td></tr>
           <%                Â
                            counter2 = 1
                            Do While Request.Form(tempVarName & counter2) <> "" 'Loop which gathers Attribute Options
           %>
           <tr><td align="right"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Option <%= counter2 %>: </td><td nowrap><input type="text" title="Option <%= tempVarName & counter2 %>" name="<%= tempVarName & counter2 %>" value="<%= Request.Form(tempVarName & counter2) %>" size="10" style="<%= C_FORMDESIGN %>" optional=true>
           <%
                                 choice = Request.Form(tempVarSet & counter2)
                                 choice0 = ""
                                 choice1 = ""
                                 choice2 = ""
                                 If choice = "0" Then
                                       choice0 = "checked"
                                 ElseIf choice = "1" Then
                                       choice1 = "checked"
                                 ElseIf choice = "2" Then
                                       choice2 = "checked"
                                 End If
           %>
                                       <font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
                                       <input type="radio" <%=choice0%> name="<%= tempVarSet & counter2 %>" value="0">Same Price
                                       <input type="radio" <%=choice1%> name="<%= tempVarSet & counter2 %>" value="1">Increase
                                       <input type="radio" <%=choice2%> name="<%= tempVarSet & counter2 %>" value="2">Decrease by:
           <%
                                Â
                                 If choice = "0" OR Request.Form(tempVarPrice & counter2) = "" Then
                                       tempVar3 = "0"
                                 Else
                                       tempVar3 = Request.Form(tempVarPrice & counter2)
                                 End If
           %>
                                 <input type="text" title="Option Price <%= counter2 %>" name="<%= tempVarPrice & counter2 %>" value="<%= tempVar3 %>" size="3" style="<%= C_FORMDESIGN %>" optional=true number=true></td></tr>
           <%
                                 counter2 = counter2 + 1
                            Loop
                            counter = counter + 1
                      Loop 'The Loops above only gather information already added
                      If addAttType = "Options"  and trim(Request.Form("T1")) <> "" Then 'If Statement addeds correct input field for new Option or Attribute Title
           %>
                            <tr><td align="right" nowrap><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>"> Option <%= counter2 %>: </td>
                            <td nowrap><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">
                            <input type="text" title="Option <%= counter2 %>" name="<%= tempVarName & counter2 %>" size="10" style="<%= C_FORMDESIGN %>" optional=true>
                            <input type="radio" checked name="<%= tempVarSet & counter2 %>" value="0">Same Price
                            <input type="radio" name="<%= tempVarSet & counter2 %>" value="1">Increase
                            <input type="radio" name="<%= tempVarSet & counter2 %>" value="2">Decrease by:
                            <input type="text" title="Option Price <%= counter2 %>" number=true name="<%= tempVarPrice & counter2 %>" size="3" style="<%= C_FORMDESIGN %>" optional=true value="0"></td></tr>
                            <tr><td align="center" colspan="2"><input type="submit" name="addAttType" value="Options"></td></tr>
                            <input type="hidden" name="attNumber" value="<%= counter-1 %>">
           <%
                      ElseIf addAttribute <> "" Then
           %>
                            <tr><td colspan="2"><hr></td></tr>
                            <tr><td align="right" noWrap><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Attribute Title: </td>
                            <td><input type="text" title="Attribute Title <%= counter %>"name="T<%=  counter %>" size="15" style="<%= C_FORMDESIGN %>"></tr></td>
                            <tr><td align="center" colspan="2">
                            <input type="submit" name="addAttType" value="Options"></td></tr>
           <%
                      End If     Â
                 End If
           End If
           %>
           </table>
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" align="center" height="21"><input type="image" name="AddAttribute" border="0" src="images/addattr.gif" height="21"></td>
    </tr>
    <tr>
           <td colspan="2" height="19"> Â
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>" height="19"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    Images</font></b></td>
    </tr>
    <tr>
    <td width="50%" height="42"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Small Image<br>
     <input type="text" name="prodImageSmallPath" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    <td width="50%" height="42"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Product Large Image<br>
     <input type="text" name="prodImageLargePath" value="<%= prodImageLargePath%>" size="20" style="<%= C_FORMDESIGN %>">
    </font>
    </td>
    </tr>
    <tr>
           <td colspan="2" height="19"> Â
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>" height="19"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    Sale Options</font></b></td>
    </tr>
    <tr>
    <%If Request.Form("prodSaleIsAc
                 <td width="50%" height="42"><input type="checkbox" name="prodSaleIsAct" value="1" checked>
           <%Else%>
                 <td width="50%" height="42"><input type="checkbox" name="prodSaleIsAct" value="1">
           <%End If%>
           <font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Activate Sale </font></td>
    <td width="50%" height="42"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Sale Price<br>
     <input type="text" title="Product Sale Price" name="prodSalePrice" value="<%= prodSalePrice%>" size="20" style="<%= C_FORMDESIGN %>">
     </font></td>
    </tr>
    <tr>
           <td colspan="2" height="19"> Â
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>" height="19"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    Shipping Options</font></b></td>
    </tr>
    <tr>
    <%If Request.Form("prodShipIsAc
                 <td width="50%" height="42"><input type="checkbox" name="prodShipIsAct" value="1" checked>
           <%Else%>
                 <td width="50%" height="42">
      <input type="checkbox" name="prodShipIsAct" value="1" checked>
           <%End If%>
           <font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Activate Shipping </font></td>
    <td width="50%" height="42"><font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Shipping Cost<br>
     <input type="text" title="Product Ship Price" name="prodShip" value="<%= prodShip%>" size="20" style="<%= C_FORMDESIGN %>">
     </font></td>
    </tr>
    <tr>
           <td colspan="2" height="19"> Â
           </td>
           </tr>
    <tr>
    <td width="100%" colspan="2" bgcolor="<%= C_BGCOLOR5 %>" background="<%= C_BKGRND5 %>" height="19"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>">
    Tax Options</font></b></td>
    </tr>
    <tr>
    <%If Request.Form("prodStateTax
                 <td width="50%" height="77"><input type="checkbox" name="prodStateTaxIsAct" value="1" checked>
           <%Else%>
                 <td width="50%" height="77"><input type="checkbox" name="prodStateTaxIsAct" value="1">
           <%End If%>
           <font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Activate State Tax</font></td>
    <%If Request.Form("prodCountryT
                 <td width="50%" height="77"><input type="checkbox" name="prodCountryTaxIsAct"
           <%Else%>
                 <td width="50%" height="77"><input type="checkbox" name="prodCountryTaxIsAct"
           <%End If%>
           <font face="<%= C_FONTFACE4 %>" color="<%= C_FONTCOLOR4 %>" size="<%= C_FONTSIZE4 %>">Activate Country Tax</font></td>
    </tr>
    <tr>
           <td colspan="2" height="19"> Â
           </td>
           </tr>
    <tr>
           <td align="center" width="100%" colspan="2" height="21"><b><font face="<%= C_FONTFACE5 %>" color="<%= C_FONTCOLOR5 %>" size="<%= C_FONTSIZE5 %>"><input type="image" name="addproduct" src="images/addproduct.gif
           </tr>
    </table><br>
  </td>
  </tr>
        <tr>
           <td bgcolor="<%= C_BGCOLOR7 %>" background="<%= C_BKGRND7 %>"><font face="<%= C_FONTFACE7 %>" color="<%= C_FONTCOLOR7 %>" size="<%= C_FONTSIZE7 %>"><p align="center"><b><a href="MT_MenuInv.asp">Stor
    </tr>
</table>
</td>
</tr>
</table>
</form>
<%'+JF 9/28/01%>
<script language="javascript" name=script2>
      if (window.document.openerFor
                 window.document.openerForm
// Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â window.document.openerForm
           }
           else {
                 window.document.openerForm
                 window.document.openerForm
           }
     Â
           if (window.document.openerFor
                 window.document.openerForm
// Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â window.document.openerForm
           }
           else {
                 window.document.openerForm
                 window.document.openerForm
           }
           if (window.document.openerFor
                 window.document.openerForm
// Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â window.document.openerForm
           }
           else {
                 window.document.openerForm
                 window.document.openerForm
           }
     Â
</script>
<%'-JF 9/28/01%>
</body>
</html>
Here is the sfcheckerrors.js file which is called at the beginning:
--------------------------
sfcheckerrors.js
--------------------------
//@BEGINVERSIONINFO
//@APPVERSION: 50.4013.0.2
//@FILENAME: sfcheckerrors.asp
     Â
//@DESCRIPTION: Checkes sfErrors
//@STARTCOPYRIGHT
//The contents of this file is protected under the United States
//copyright laws as an unpublished work, and is confidential and proprietary to
//LaGarde, Incorporated. Â Its use or disclosure in whole or in part without the
//expressed written permission of LaGarde, Incorporated is expressly prohibited.
//(c) Copyright 2000 by LaGarde, Incorporated. Â All rights reserved.
//@ENDCOPYRIGHT
//@ENDVERSIONINFO
function specialCase(e, form) {
      if ((e.name == "CardName")||(e.name == "CardNumber")||(e.name == "CardExpiryMonth")||(e.nam
           if (((form.CardName.value.len
            && ((form.CardName.value.leng
                 return "Please enter all Credit Card Information.";
           }
           if ((form.CardName.value.leng
                 if (!isCardDateValid(form.Car
                      return "The Credit Card has Expired.";
                 }
                 if (isCardNumValid(form.CardN
                      return "The Credit Card Number is an invalid format.";
                 }
           }
      }
      if ((e.name == "CheckNumber")||(e.name == "BankName")||(e.name == "RoutingNumber")||(e.name == "CheckingAccountNumber")) {
           if (((form.CheckNumber.value.
            && ((form.CheckNumber.value.l
                 return "Please enter all eCheck Information.";
           }           Â
      }
      if ((e.name == "POName")||(e.name == "PONumber")) {
          Â
           if (((form.POName.value.lengt
            && ((form.POName.value.length
                 return "Please enter all Purchase Order Information.";
           }
      }
      if ((form.CardName.value.leng
      && (form.CheckNumber.value.le
      && (form.POName.value.length <= 0)&&(form.PONumber.value.l
           return "Please enter payment method Information.";     Â
      }
      return "";
}
function stripChar(sValue, sChar) {
      var i, tempChar, buildString;
      buildString = ""
      for (var i=0; i<sValue.length; i++) {
           tempChar = sValue.charAt(i);
           if (tempChar != sChar) {
                 buildString = buildString + tempChar;
           }
      }
      return buildString;
}
function isCardDateValid(year, month) {
      var dateCheck, now;
      if (year.length == 2) {
           if (parseInt(year) < 50) {
                 year = "20" + year;
           }
      }
      now = new Date();
      dateCheck = new Date(year, month);
      if (now > dateCheck) {
           return false;
      }
      else {
           return true;
      }
}
function isCardNumValid(num) {
      var num1, num2, tempNum;
      if (!isNumber(num)) {
           return true;
      }
      num1 = ""
      if (!(num.length%2==0)) {
           for(var j=0; j < num.length; j++) {
                 if ((j+1)%2==0){
                      tempNum = 2 * num.charAt(j);
                 }
                 else {
                      tempNum = 1 * num.charAt(j);
                 }
                 num1 = num1 + tempNum.toString();
           }
      }
      else{
           for(var j=0; j < num.length; j++){
                 if ((j+1)%2==0){
                      tempNum = 1 * num.charAt(j);
                 }
                 else{
                      tempNum = 2 * num.charAt(j);
                 }
                 num1 = num1 + tempNum.toString();
           }
      }
      num2 = 0;
      for (var j = 0; j < num1.length; j++) {
           num2 = num2 + parseInt(num1.charAt(j));
      }
      if (num2%10==0) {
           return false;
      }
      else {
           return true;
      }
}
function isNumber(value) {
      for (var i=0; i < value.length; i++) {
           a = parseInt(value.charAt(i));
           if (isNaN(a)) {
                 return false;                Â
                 break;
           }
      }
      return true;
}
function sfCheck(form) {
      var e, title, empty_fields, char_check, invalid_card, month, year, invalid_date, eMail, invalid_eMail
      var iQuantity, quantity_check, checkSpecial, tempError, special_Error, msg, upperLine, lowerLine
      var num, invalid_phoneNumber, passwd_mismatch
      msg = "";
      empty_fields = "";
      char_check = "";
      special_Error = "";
      tempError = "";
      num = form.length
      for (var i = 0; i < form.length; i++) {
           e = form.elements[i]
           if ((e.title == null)||(e.title == "")) {
                 title = e.name;
           }
           else {
                 title = e.title;
           }
           if (((e.type == "text") || (e.type == "textarea")||(e.type == "password")) && !e.special && !e.disabled) {
                 if (e.value.length <= 0 && !e.optional && (e.name.indexOf("Ship") == -1)) {
                      empty_fields += "\n       " + title;
                      continue;
                 }
                 if (e.number) {
                      num = e.value;
                      num = stripChar(num, ".");
                      num = stripChar(num, ",");
                      if (!isNumber(num)) {
                            char_check += "\n       " + title;
                      }
                 }
                 if (e.creditCardNumber) {
                      e.value = stripChar(e.value, " ");
                      e.value = stripChar(e.value, "-");
                      invalid_card = isCardNumValid(e.value);
                 }
                Â
                 if ((e.creditCardExpMonth)||(
                      if (e.creditCardExpMonth) {
                            month = e.value;
                            month = stripChar(month, " ")
                            if (!isNumber(month)) {
                                 invalid_date = true;
                                 month = null;
                            }
                      }
                      if (e.creditCardExpYear) {
                            year = e.value;
                            year = stripChar(year, " ")
                            if (!isNumber(year)) {
                                 invalid_date = true;
                                 year = null;
                            }
                      }
                      if ((month != null) && (year != null)) {
                            if(!isCardDateValid(year, month)) {
                                 invalid_date = true;
                            }     Â
                      }
                 }
                 if (e.eMail) {
                      eMail = e.value;
                      if ((eMail.indexOf("@") != -1) && (eMail.indexOf(".") != -1)) {
                            invalid_eMail = false;
                      }
                      else {
                            invalid_eMail = true;
                      }
                 }
            if (e.name == "txtEmail") {
                      eMail = e.value;
                      if ((eMail.indexOf("@") != -1) && (eMail.indexOf(".") != -1)) {
                            invalid_eMail = false;
                      }
                      else {
                      Â
                            invalid_eMail = true;
                      }
                 }     Â
                 if (e.name == "txtFriend") {
                      eMail = e.value;
                      if ((eMail.indexOf("@") != -1) && (eMail.indexOf(".") != -1)) {
                            invalid_eMail = false;
                      }
                      else {
                      Â
                            invalid_eMail = true;
                      }
                 }     Â
                 if (e.phoneNumber) {
                      num = e.value;
                      num = stripChar(num, " ");
                      num = stripChar(num, "-");
                      num = stripChar(num, "+");
                      if (num.length < 10) {
                            invalid_phoneNumber = true;
                      }     Â
                 }
           }
           if (e.quantityBox) {
                 iQuantity = e.value;
                 if (!isNumber(iQuantity)) {
                      quantity_check = true;
                 }
                 if (parseInt(iQuantity) < 0) {
                      quantity_check = true;
                 }
                 if ((iQuantity) < 1) {
                      quantity_check = true;
                 }
           }
           if (e.password) {
                 if (form.Password.value != form.Password2.value) {
                            passwd_mismatch = true;
                 }
           }
           if (e.special) {
                 checkSpecial = specialCase(e, form);
                 if (tempError != checkSpecial) {
                      special_Error = special_Error + checkSpecial
                 }
                 tempError = checkSpecial;
           }
           if (e.type == "select-one" && !e.optional) {
                 if (e.value == "") {
                      empty_fields += "\n       " + title;
                      continue;
                 }
           }
      }
     Â
      if (!empty_fields && !char_check && !special_Error && !invalid_card && !invalid_date && !invalid_eMail && !quantity_check && !invalid_phoneNumber && !passwd_mismatch) {return true}
     Â
      msg = "The form was not submited due to the following error(s).\n";
     Â
      upperLine = "\n_______________________
      lowerLine = "_________________________
     Â
      if (empty_fields) {
           msg += upperLine;
           msg += "The following field(s) must be filled in:\n";
           msg += lowerLine;
           msg += empty_fields;
      }
      if (char_check) {
           msg += upperLine;
           msg += "The following field(s) need a numeric value:\n";
           msg += lowerLine;
           msg += char_check;
      }
      if (quantity_check) {
           msg += upperLine;
           msg += "Please Enter a Positive Integer.\n"
           msg += lowerLine;
      }
      if (invalid_card) {
           msg += upperLine;
           msg += "The Credit Card Number is an invalid format.\n";
           msg += lowerLine;
      }
      if (invalid_date) {
           msg += upperLine;
           msg += "The Credit Card has Expired.\n";
           msg += lowerLine;
      }
      if (invalid_eMail) {
           msg += upperLine;
           msg += "The Email Address is in an invalid format.\n";
           msg += lowerLine;
      }
      if (invalid_phoneNumber) {
           msg += upperLine;
           msg += "Please enter a valid Phone Number with area code.\n";
           msg += lowerLine;
      }
      if (special_Error) {
           msg += upperLine;
           msg += special_Error + "\n";
           msg += lowerLine;
      }
      if (passwd_mismatch) {
           msg += upperLine;
           msg += "Your passwords did not match. Please enter them again.\n";
           msg += lowerLine;
      }           Â
      alert(msg);
      return false;
} Â Â Â Â Â
function sfCheckPlus(frm) {
     Â
      if (window.document.form1.Shi
      {
      if (window.document.form1.Shi
      {
      window.alert("Please either fill in all shipping info or no shipping info.")
      return false
      }
      else
      {return sfCheck(frm)}
      }            Â
}
function POCheck(poname,poNum)
{
 if(poname == "" || poNum == "")
  {
  alert("Please Enter the required purchase order information");
  Â
  return false;
  }
  else
  {
   return true;
  }
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You da man! :)
glad i could help and thanks for the A
jAy
jAy
 if(e.name == "prodLink1" || e.name == "prodLink2" || e.name == "prodLink3" || e.name == "prodLink4"){
      if(e.value == ""){ return true;}}