<% @LANGUAGE = VBScript %> <% Option Explicit %> <% Function isCartEmpty() isCartEmpty = True if isArray(Session("myArray")) then isCartEmpty = False End If if isArray(Session("YD")) then isCartEmpty = False End If if isArray(Session("VV")) then isCartEmpty = False End If if isArray(Session("TWP")) then isCartEmpty = False End If if isArray(Session("THP")) then isCartEmpty = False End If if isArray(Session("STP")) then isCartEmpty = False End If if isArray(Session("SPP")) then isCartEmpty = False End If if isArray(Session("SP")) then isCartEmpty = False End If if isArray(Session("SCP")) then isCartEmpty = False End If if isArray(Session("RP")) then isCartEmpty = False End If if isArray(Session("OPP")) then isCartEmpty = False End If if isArray(Session("MP")) then isCartEmpty = False End If if isArray(Session("LP")) then isCartEmpty = False End If if isArray(Session("ITYP")) then isCartEmpty = False End If if isArray(Session("HDP")) then isCartEmpty = False End If if isArray(Session("FUP")) then isCartEmpty = False End If if isArray(Session("FLP")) then isCartEmpty = False End If if isArray(Session("COP")) then isCartEmpty = False End If if isArray(Session("CHP")) then isCartEmpty = False End If if isArray(Session("KS")) then isCartEmpty = False End If if isArray(Session("KP")) then isCartEmpty = False End If if isArray(Session("WP")) then isCartEmpty = False End If if isArray(Session("WS")) then isCartEmpty = False End If if isArray(Session("VL")) then isCartEmpty = False End If if isArray(Session("PL")) then isCartEmpty = False End If End Function 'if they didn't push the submit button then display the form function ValidateInput() Dim okay Dim message okay = true if Request.Form("name") = "" then okay = false message = message & "Full Name
" End If if Request.Form("company") = "" then okay = false message = message & "Company
" End If if Request.Form("address") = "" then okay = false message = message & "Mailing Address
" End If if Request.Form("city") = "" then okay = false message = message & "City
" End If if Request.Form("state") = "" then okay = false message = message & "State/Prov
" End If if Request.Form("zip") = "" then okay = false message = message & "Zip Code
" End If if Request.Form("teleareacode") = "" then okay = false message = message & "Area Code
" End If if Request.Form("telephone") = "" then okay = false message = message & "Telephone Number
" End If if isEmailAddress(Request.Form("email")) = false then okay = false message = message & " Invalid Email Address
" End If if okay = false then Response.write("
Wholesale Fabric Apparel Woven Material Notions
") Response.Write "

The following fields need to be filled out correctly before the form can be processed:

" Response.Write "" & message & "" Response.Write "

Please use your browser's back button to go back to the form and complete the above fields.

" End If ValidateInput = okay End Function Function IsEmailAddress(ByVal sEmailAddress) Dim x, CurrentStr, TChar, blnIsEmailAddress Dim nLocationAt, nLocationPeriod blnIsEmailAddress = FALSE If LEN(sEmailAddress) > 0 Then blnIsEmailAddress = False If sEmailAddress <> "" Then nLocationAt = InStr(sEmailAddress, "@") If nLocationAt <> 0 Then nLocationPeriod = InStr(nLocationAt, sEmailAddress, ".") If nLocationAt > 1 And _ nLocationPeriod > (nLocationAt + 1) And _ nLocationPeriod < Len(sEmailAddress) - 1 Then blnIsEmailAddress = True End If End If If blnIsEmailAddress = True Then For x=1 to Len(sEmailAddress) CurrentStr=Left(sEmailAddress,x) TChar=UCASE(Right(CurrentStr, 1)) If TChar="$" or TChar="`" or TChar="!" or TChar="#" or _ TChar="%" or TChar="^" or TChar="&" or TChar="," or _ TChar="*" or TChar="(" or TChar=")" or TChar="=" or _ TChar="[" or TChar="{" or TChar="]" or TChar="}" or _ TChar="|" or TChar="\" or TChar=";" or TChar=":" or _ TChar="'" or TChar="+" or TChar=""<"" or TChar="~" or _ TChar=">" or TChar="?" or TChar="/" or TChar=" " Then blnIsEmailAddress=FALSE Exit For End If Next End If End If IsEmailAddress = blnIsEmailAddress End Function 'if they did not click the 'send order' button, then display the order form If Request.Form("SendButton") <> "Send Order" Then %> Order Form

Complete the request form to receive samples
of the fabrics in your wish list.

Please note that we are NOT an internet retail company. Wholesale order is 20 yards per fabric.

">
Name *
Company *
Address *
City *
State/Prov *
Zip *
Country
Telephone ( ) * We will not send samples to invalid telephone numbers.
Fax ( )
Email *

The Following Fabrics will be sent for processing:

<% ' loop through the fabrics they have selected Dim i1, i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16,i17,i18,i19,i20,i21,i22,i23,i24,j if isArray(Session("YD")) then Response.Write "Yarn Dyes (" & Ubound(Session("YD"))+1 & ")
" for i1=Lbound(Session("YD")) to Ubound(Session("YD")) Response.Write trim(Session("YD")(i1)) & "
" Next Response.Write "
" End If if isArray(Session("VV")) then Response.Write "Velour & Velvets (" & Ubound(Session("VV"))+1 & ")
" for i2=Lbound(Session("VV")) to Ubound(Session("VV")) Response.Write trim(Session("VV")(i2)) & "
" Next Response.Write "
" End If if isArray(Session("TWP")) then Response.Write "Twill/Denim/Canvas (" & Ubound(Session("TWP"))+1 & ")
" for i3=Lbound(Session("TWP")) to Ubound(Session("TWP")) Response.Write trim(Session("TWP")(i3)) & "
" Next Response.Write "
" End If if isArray(Session("THP")) then Response.Write "Theme Prints (" & Ubound(Session("THP"))+1 & ")
" for i4=Lbound(Session("THP")) to Ubound(Session("THP")) Response.Write trim(Session("THP")(i4)) & "
" Next Response.Write "
" End If if isArray(Session("STP")) then Response.Write "Stretch Sateen & Twill (" & Ubound(Session("STP"))+1 & ")
" for i5=Lbound(Session("STP")) to Ubound(Session("STP")) Response.Write trim(Session("STP")(i5)) & "
" Next Response.Write "
" End If if isArray(Session("SPP")) then Response.Write "Stretch Poplin (" & Ubound(Session("SPP"))+1 & ")
" for i6=Lbound(Session("SPP")) to Ubound(Session("SPP")) Response.Write trim(Session("SPP")(i6)) & "
" Next Response.Write "
" End If if isArray(Session("SP")) then Response.Write "Seasonal (" & Ubound(Session("SP"))+1 & ")
" for i7=Lbound(Session("SP")) to Ubound(Session("SP")) Response.Write trim(Session("SP")(i7)) & "
" Next Response.Write "
" End If if isArray(Session("SCP")) then Response.Write "Scrub Prints (" & Ubound(Session("SCP"))+1 & ")
" for i8=Lbound(Session("SCP")) to Ubound(Session("SCP")) Response.Write trim(Session("SCP")(i8)) & "
" Next Response.Write "
" End If if isArray(Session("RP")) then Response.Write "Rayon Prints (" & Ubound(Session("RP"))+1 & ")
" for i9=Lbound(Session("RP")) to Ubound(Session("RP")) Response.Write trim(Session("RP")(i9)) & "
" Next Response.Write "
" End If if isArray(Session("OPP")) then Response.Write "Other Polyester Prints (" & Ubound(Session("OPP"))+1 & ")
" for i10=Lbound(Session("OPP")) to Ubound(Session("OPP")) Response.Write trim(Session("OPP")(i10)) & "
" Next Response.Write "
" End If if isArray(Session("MP")) then Response.Write "Mesh, Onionskin Prints (" & Ubound(Session("MP"))+1 & ")
" for i11=Lbound(Session("MP")) to Ubound(Session("MP")) Response.Write trim(Session("MP")(i11)) & "
" Next Response.Write "
" End If if isArray(Session("LP")) then Response.Write "Linen (" & Ubound(Session("LP"))+1 & ")
" for i12=Lbound(Session("LP")) to Ubound(Session("LP")) Response.Write trim(Session("LP")(i12)) & "
" Next Response.Write "
" End If if isArray(Session("ITYP")) then Response.Write "ITY, Single Span, Butterknit (" & Ubound(Session("ITYP"))+1 & ")
" for i13=Lbound(Session("ITYP")) to Ubound(Session("ITYP")) Response.Write trim(Session("ITYP")(i13)) & "
" Next Response.Write "
" End If if isArray(Session("HDP")) then Response.Write "Home Decor Prints (" & Ubound(Session("HDP"))+1 & ")
" for i14=Lbound(Session("HDP")) to Ubound(Session("HDP")) Response.Write trim(Session("HDP")(i14)) & "
" Next Response.Write "
" End If if isArray(Session("FUP")) then Response.Write "Fur Prints (" & Ubound(Session("FUP"))+1 & ")
" for i15=Lbound(Session("FUP")) to Ubound(Session("FUP")) Response.Write trim(Session("FUP")(i15)) & "
" Next Response.Write "
" End If if isArray(Session("FLP")) then Response.Write "Flannel Prints (" & Ubound(Session("FLP"))+1 & ")
" for i16=Lbound(Session("FLP")) to Ubound(Session("FLP")) Response.Write trim(Session("FLP")(i16)) & "
" Next Response.Write "
" End If if isArray(Session("COP")) then Response.Write "Corduroy Prints (" & Ubound(Session("COP"))+1 & ")
" for i17=Lbound(Session("COP")) to Ubound(Session("COP")) Response.Write trim(Session("COP")(i17)) & "
" Next Response.Write "
" End If if isArray(Session("CHP")) then Response.Write "Chiffon Prints (" & Ubound(Session("CHP"))+1 & ")
" for i18=Lbound(Session("CHP")) to Ubound(Session("CHP")) Response.Write trim(Session("CHP")(i18)) & "
" Next Response.Write "
" End If if isArray(Session("KP")) then Response.Write "Knit Lycra Prints (" & Ubound(Session("KP"))+1 & ")
" for i19=Lbound(Session("KP")) to Ubound(Session("KP")) Response.Write trim(Session("KP")(i19)) & "
" Next Response.Write "
" End If if isArray(Session("KS")) then Response.Write "Knit Solids (" & Ubound(Session("KS"))+1 & ")
" for i20=Lbound(Session("KS")) to Ubound(Session("KS")) Response.Write trim(Session("KS")(i20)) & "
" Next Response.Write "
" End If if isArray(Session("WP")) then Response.Write "Woven Prints (" & Ubound(Session("WP"))+1 & ")
" for i21=Lbound(Session("WP")) to Ubound(Session("WP")) Response.Write trim(Session("WP")(i21)) & "
" Next Response.Write "
" End If if isArray(Session("WS")) then Response.Write "Woven Solids (" & Ubound(Session("WS"))+1 & ")
" for i22=Lbound(Session("WS")) to Ubound(Session("WS")) Response.Write trim(Session("WS")(i22)) & "
" Next Response.Write "
" End If if isArray(Session("PL")) then Response.Write "Pile (" & Ubound(Session("PL"))+1 & ")
" for i23=Lbound(Session("PL")) to Ubound(Session("PL")) Response.Write trim(Session("PL")(i23)) & "
" Next Response.Write "
" End If if isArray(Session("VL")) then Response.Write "Voile & Lawn (" & Ubound(Session("VL"))+1 & ")
" for i24=Lbound(Session("VL")) to Ubound(Session("VL")) Response.Write trim(Session("VL")(i24)) & "
" Next Response.Write "
" End If if isArray(Session("myArray")) then Response.Write "Knit Prints (" & Ubound(Session("myArray"))+1 & ")
" for j=Lbound(Session("myArray")) to Ubound(Session("myArray")) Response.Write trim(Session("myArray")(j)) & "
" Next Response.Write "
" End If %>


<% Else 'they clicked the 'send order' button to submit the form - send the data. if isCartEmpty() = false then 'redirect to thank you page????? if ValidateInput() = true then Dim BodyToSend, Mailer, recipient, sender, subject, result, mailserver Set Mailer = Server.CreateObject("SMTPsvg.Mailer") '-- the next line enables queue functions and can '-- be set to false if you don't want to queue Mailer.QMessage = false Mailer.FromName = Request.Form("name") Mailer.FromAddress= "orders@mctextiles.com" 'must be of same domain as server '-- The next line should be set for the SMTP server '-- address of your ISP or webhost Mailer.ReplyTo = Request.Form("email") Mailer.RemoteHost = "mctextiles.com" '-- AddRecipient sets the name of the recipient and '-- the email address of the recipient - customize!! Mailer.AddRecipient "Fabric Order Department", "fari@mctextiles.com" Mailer.Subject = "Fabric Order from " & Request.Form("name") ' build the text from the form objects to go inside the email BodyToSend = BodyToSend & "Name: " & Request.Form("name") & vbcrlf BodyToSend = BodyToSend & "Email: " & Request.Form("email") & vbcrlf BodyToSend = BodyToSend & "Company: " & Request.Form("company") & vbcrlf BodyToSend = BodyToSend & "Address: " & Request.Form("address")& vbcrlf BodyToSend = BodyToSend & "City: " & Request.Form("city") & vbcrlf BodyToSend = BodyToSend & "State/Prov: " & Request.Form("state") & vbcrlf BodyToSend = BodyToSend & "Zip: " & Request.Form("zip") & vbcrlf BodyToSend = BodyToSend & "Country: " & Request.Form("country") & vbcrlf BodyToSend = BodyToSend & "Area Code: " & Request.Form("teleareacode") & vbcrlf BodyToSend = BodyToSend & "Telephone: " & Request.Form("telephone") & vbcrlf BodyToSend = BodyToSend & "Fax: " & Request.Form("fax") & vbcrlf & vbcrlf ' add the fabrics they have selected to the email message if isArray(Session("YD")) then BodyToSend = BodyToSend & "Yarn Dyes: Quantity(" & Ubound(Session("YD"))+1 & ")" for i1=Lbound(Session("YD")) to Ubound(Session("YD")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("YD")(i1)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("VV")) then BodyToSend = BodyToSend & "Velour & Velvet Prints: Quantity(" & Ubound(Session("VV"))+1 & ")" for i2=Lbound(Session("VV")) to Ubound(Session("VV")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("VV")(i2)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("TWP")) then BodyToSend = BodyToSend & "Twill/Denim/Canvas: Quantity(" & Ubound(Session("TWP"))+1 & ")" for i3=Lbound(Session("TWP")) to Ubound(Session("TWP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("TWP")(i3)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("THP")) then BodyToSend = BodyToSend & "Theme Prints: Quantity(" & Ubound(Session("THP"))+1 & ")" for i4=Lbound(Session("THP")) to Ubound(Session("THP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("THP")(i4)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("STP")) then BodyToSend = BodyToSend & "Stretch Sateen & Twill: Quantity(" & Ubound(Session("STP"))+1 & ")" for i5=Lbound(Session("STP")) to Ubound(Session("STP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("STP")(i5)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("SPP")) then BodyToSend = BodyToSend & "Stretch Poplin: Quantity(" & Ubound(Session("SPP"))+1 & ")" for i6=Lbound(Session("SPP")) to Ubound(Session("SPP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("SPP")(i6)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("SP")) then BodyToSend = BodyToSend & "Seasonal: Quantity(" & Ubound(Session("SP"))+1 & ")" for i7=Lbound(Session("SP")) to Ubound(Session("SP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("SP")(i7)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("SCP")) then BodyToSend = BodyToSend & "Scrub Prints: Quantity(" & Ubound(Session("SCP"))+1 & ")" for i8=Lbound(Session("SCP")) to Ubound(Session("SCP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("SCP")(i8)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("RP")) then BodyToSend = BodyToSend & "Rayon Prints: Quantity(" & Ubound(Session("RP"))+1 & ")" for i9=Lbound(Session("RP")) to Ubound(Session("RP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("RP")(i9)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("OPP")) then BodyToSend = BodyToSend & "Other Polyester Prints: Quantity(" & Ubound(Session("OPP"))+1 & ")" for i10=Lbound(Session("OPP")) to Ubound(Session("OPP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("OPP")(i10)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("MP")) then BodyToSend = BodyToSend & "Mesh, Onionskin Prints: Quantity(" & Ubound(Session("MP"))+1 & ")" for i11=Lbound(Session("MP")) to Ubound(Session("MP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("MP")(i11)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("LP")) then BodyToSend = BodyToSend & "Linen Prints: Quantity(" & Ubound(Session("LP"))+1 & ")" for i12=Lbound(Session("LP")) to Ubound(Session("LP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("LP")(i12)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("ITYP")) then BodyToSend = BodyToSend & "ITY, Single Span, Butterknit: Quantity(" & Ubound(Session("ITYP"))+1 & ")" for i13=Lbound(Session("ITYP")) to Ubound(Session("ITYP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("ITYP")(i13)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("HDP")) then BodyToSend = BodyToSend & "Home Decor Prints: Quantity(" & Ubound(Session("HDP"))+1 & ")" for i14=Lbound(Session("HDP")) to Ubound(Session("HDP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("HDP")(i14)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("FUP")) then BodyToSend = BodyToSend & "Fur Prints: Quantity(" & Ubound(Session("FUP"))+1 & ")" for i15=Lbound(Session("FUP")) to Ubound(Session("FUP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("FUP")(i15)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("FLP")) then BodyToSend = BodyToSend & "Flannel Prints: Quantity(" & Ubound(Session("FLP"))+1 & ")" for i16=Lbound(Session("FLP")) to Ubound(Session("FLP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("FLP")(i16)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("COP")) then BodyToSend = BodyToSend & "Corduroy Prints: Quantity(" & Ubound(Session("COP"))+1 & ")" for i17=Lbound(Session("COP")) to Ubound(Session("COP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("COP")(i17)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("CHP")) then BodyToSend = BodyToSend & "Chiffon Prints: Quantity(" & Ubound(Session("CHP"))+1 & ")" for i18=Lbound(Session("CHP")) to Ubound(Session("CHP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("CHP")(i18)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("KP")) then BodyToSend = BodyToSend & "Knit Lycra Prints: Quantity(" & Ubound(Session("KP"))+1 & ")" for i19=Lbound(Session("KP")) to Ubound(Session("KP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("KP")(i19)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If if isArray(Session("KS")) then BodyToSend = BodyToSend & "Knit Solids: Quantity(" & Ubound(Session("KS"))+1 & ")" for i20=Lbound(Session("KS")) to Ubound(Session("KS")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("KS")(i20)) Next BodyToSend = BodyToSend & vbcrlf & vbcrlf End If if isArray(Session("WP")) then BodyToSend = BodyToSend & "Woven Prints: Quantity(" & Ubound(Session("WP"))+1 & ")" for i21=Lbound(Session("WP")) to Ubound(Session("WP")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("WP")(i21)) Next BodyToSend = BodyToSend & vbcrlf & vbcrlf End If if isArray(Session("WS")) then BodyToSend = BodyToSend & "Woven Solids: Quantity(" & Ubound(Session("WS"))+1 & ")" for i22=Lbound(Session("WS")) to Ubound(Session("WS")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("WS")(i22)) Next BodyToSend = BodyToSend & vbcrlf & vbcrlf End If if isArray(Session("PL")) then BodyToSend = BodyToSend & "Pile: Quantity(" & Ubound(Session("PL"))+1 & ")" for i23=Lbound(Session("PL")) to Ubound(Session("PL")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("PL")(i23)) Next BodyToSend = BodyToSend & vbcrlf & vbcrlf End If if isArray(Session("VL")) then BodyToSend = BodyToSend & "Voile & Lawn: Quantity(" & Ubound(Session("VL"))+1 & ")" for i24=Lbound(Session("VL")) to Ubound(Session("VL")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("VL")(i24)) Next BodyToSend = BodyToSend & vbcrlf & vbcrlf End If if isArray(Session("myArray")) then BodyToSend = BodyToSend & "Knit Prints: Quantity(" & Ubound(Session("myArray"))+1 & ")" for j=Lbound(Session("myArray")) to Ubound(Session("myArray")) BodyToSend = BodyToSend & vbcrlf & " " & trim(Session("myArray")(j)) Next BodyToSend = BodyToSend& vbcrlf &vbcrlf End If Mailer.BodyText = BodyToSend Response.Write("
Wholesale Fabric Apparel Woven Material Notions
") if Mailer.SendMail then '-- confirm mail was sent - customize as desired Response.Write "

Thank you for your order!
Mail was been sent sucessfully.

" else '-- return error message - customized as desired Response.Write "

Mail was not sent, error message is " & mailer.response & "

" End If End If Else Response.Write "

Your wish list is empty.
Please press your browser's back button and select one or more fabrics before ordering.

Thank you!

" End If On Error resume next If Err.Number <> 0 Then Response.Write "
Error: " & Err.Description End If set Mailer=nothing End If %>