Jump to content

Need Asp Help..


p8baller07

Recommended Posts

<%@ LANGUAGE="VBSCRIPT" %>
<% Response.Expires = 0 
'Response.CacheControl = "no-cache"
Response.ExpiresAbsolute = Now()- 1000

'On Error Resume Next
txtEngraveCode = Request.Form("engravecode")

If txtEngraveCode = "2E" Then
If Request.Form("font2") = "-" Then
Dim txtEngraveCode
txtEngraveCode = "E"
End If
End If

If txtEngraveCode = "2P" Then
If Request.Form("fontplaque2") = "-" Then
txtEngraveCode = "P"
End If
End If


If txtEngraveCode = "2D" Then
If Request.Form("font2") = "-" Then
txtEngraveCode = "D"
End If
End If

Dim txtFontPlaque
If txtEngraveCode = "2P" Then
txtFontPlaque = Request.Form("fontplaque") & "/" & Request.Form("fontplaque2") 
Else
txtFontPlaque = Request.Form("fontplaque")
End If
Dim txtFont
If txtEngraveCode = "2E" Then
txtFont = Request.Form("font") & "/" & Request.Form("font2")  
Else
txtFont = Request.Form("font")
End If



If txtEngraveCode <> "2E" Then
If txtEngraveCode = "2D" Then
txtFont = Request.Form("font") & "/" & Request.Form("font2")  
Else
txtFont = Request.Form("font")
End If
End If

txtEngraveCode = Request.Form("engravecode")


Dim aryLocalCart, i, j
aryLocalCart = Session("Cart")
Dim intRowEntries, intItemNumber, intMaxItems
intRowEntries = 9
intItemNumber = Session("ItemNumber")
intMaxItems = Session("MaxItems")

' ----- begin initialize variables -----
curEngravePrice1 = 0.00
curEngravePrice2 = 0.00
intCount = 0
' ----- end initialize variables -----

' ----- begin collect info and compute product engraving fee -----

curSetUpFee = Request.Form("setupfee")


txtFont1 = Request.Form("font")
txtFont2 = Request.Form("font2")

txtFontPlaque1 = Request.Form("fontplaque")
txtFontPlaque2 = Request.Form("fontplaque2")

txtDirectEngraving1 = Trim(Request.Form("directengraving1"))
strSearchFor = " "
aryDirectEngraving1 = Split(txtDirectEngraving1,strSearchFor)
intLengthEngraving1 = Len(txtDirectEngraving1) - UBound(aryDirectEngraving1)


txtDirectEngraving2 = Trim(Request.Form("directengraving2"))
strSearchFor = " "
aryDirectEngraving2 = Split(txtDirectEngraving2,strSearchFor)
intLengthEngraving2 = Len(txtDirectEngraving2) - UBound(aryDirectEngraving2)

txtInstructions1 = Trim(Request.Form("instructions1"))
txtInstructions2 = Trim(Request.Form("instructions2"))

' ----- begin truncate font info to just font name -----
strSearchFor = " ("
intCount = InStr(txtFont1,strSearchFor)
txtFont1 = Left(txtFont,intCount)
txtFont1 = Trim(txtFont)

intCount = InStr(txtFont2,strSearchFor)
txtFont2 = Left(txtFont2,intCount)
txtFont2 = Trim(txtFont2)


intCount = InStr(txtFontPlaque1,strSearchFor)
txtFontPlaque1 = Left(txtFontPlaque,intCount)
txtFontPlaque1 = Trim(txtFontPlaque)

intCount = InStr(txtFontPlaque2,strSearchFor)
txtFontPlaque2 = Left(txtFontPlaque,intCount)
txtFontPlaque2 = Trim(txtFontPlaque)


' ----- end truncate font info to just font name -----

If txtEngraveCode = "E" OR txtEngraveCode = "D" OR txtEngraveCode = "2E" OR txtEngraveCode = "2D" Then

     If txtDirectEngraving1 = "" AND txtInstructions1 <> "Type instructions here." then txtDirectEngraving1 = "NO ENGRAVING TEXT ENTERED - ONLY INSTRUCTIONS: " & txtInstructions1
     If txtDirectEngraving2 = "" AND txtInstructions2 <> "Type instructions here." then txtDirectEngraving2 = "NO ENGRAVING TEXT ENTERED" & txtInstructions2
If txtDirectEngraving1 <> "" Then
  	 
 If intLengthEngraving1 > 0 AND intLengthEngraving1 <= 30 Then
	 curEngravePrice1 = curSetUpFee + (.40 * intLengthEngraving1)
 ElseIf intLengthEngraving1 > 30 AND intLengthEngraving1 < 50 Then
	 curEngravePrice1 = curSetUpFee + 12.00 + (.20 * (intLengthEngraving1 - 30))
 ElseIf intLengthEngraving1 >= 50 Then
	 curEngravePrice1 = curSetUpFee + 15.80 + (.10 * (intLengthEngraving1 - 49))
 End If

 aryLocalCart(5,intItemNumber) = txtFont 
 If txtInstructions1 = "Type instructions here." Then
	 aryLocalCart(6,intItemNumber) = txtDirectEngraving1 
 Else
	 aryLocalCart(6,intItemNumber) = txtDirectEngraving1 & " {[" & txtInstructions1 & "]}"
 End If
 aryLocalCart(7,intItemNumber) = " "
 aryLocalCart(8,intItemNumber) = curEngravePrice1
End If

If (txtEngraveCode = "2E" OR txtEngraveCode = "2D") AND txtDirectEngraving2 <> "" Then
 
 If intLengthEngraving2 > 0 AND intLengthEngraving2 <= 30 Then
	 curEngravePrice2 = curSetUpFee + (.40 * intLengthEngraving2)
 ElseIf intLengthEngraving2 > 30 AND intLengthEngraving2 < 50 Then
	 curEngravePrice2 = curSetUpFee + 12.00 + (.20 * (intLengthEngraving2 - 30))
 ElseIf intLengthEngraving2 >= 50 Then
	 curEngravePrice2 = curSetUpFee + 15.80 + (.10 * (intLengthEngraving2 - 49))
 End If
 If txtInstructions2 = "Type instructions here." Then
	 aryLocalCart(7,intItemNumber) = txtDirectEngraving2 
 Else
	 aryLocalCart(7,intItemNumber) = txtDirectEngraving2 & " {[" & txtInstructions2 & "]}"
 End If
 aryLocalCart(8,intItemNumber) = curEngravePrice1 + curEngravePrice2	
End If
End If
' ----- end collect info and compute product engraving fee -----

' ----- begin collect info and compute plaque engraving fee -----

If txtEngraveCode = "P" Then

txtBlackOxidize = Request.Form("blackoxidize")
txtEngraveLine1 = Trim(Request.Form("engraveline1"))
txtEngraveLine2 = Trim(Request.Form("engraveline2"))
txtEngraveLine3 = Trim(Request.Form("engraveline3"))
txtEngraveLine4 = Trim(Request.Form("engraveline4"))
txtEngraveLine5 = Trim(Request.Form("engraveline5"))
txtEngraveLine6 = Trim(Request.Form("engraveline6"))
txtEngraveLine7 = Trim(Request.Form("engraveline7"))
txtEngraveLine8 = Trim(Request.Form("engraveline8"))
txtEngraveLine9 = Trim(Request.Form("engraveline9"))
txtEngraveLine10 = Trim(Request.Form("engraveline10"))
txtEngraveLine11 = Trim(Request.Form("engraveline11"))
txtEngraveLine12 = Trim(Request.Form("engraveline12"))

txtInstructions3 = Trim(Request.Form("instructions3"))

intLineCount1 = 0
If Len(txtEngraveLine1) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = "1) " & txtEngraveLine1
End If
If Len(txtEngraveLine2) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 2) " & txtEngraveLine2
End If
If Len(txtEngraveLine3) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 3) " & txtEngraveLine3
End If
If Len(txtEngraveLine4) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 4) " & txtEngraveLine4
End If
If Len(txtEngraveLine5) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 5) " & txtEngraveLine5
End If
If Len(txtEngraveLine6) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 6) " & txtEngraveLine6
End If
If Len(txtEngraveLine7) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 7) " & txtEngraveLine7
End If
If Len(txtEngraveLine8) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 8) " & txtEngraveLine8
End If
If Len(txtEngraveLine9) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 9) " & txtEngraveLine9
End If
If Len(txtEngraveLine10) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 10) " & txtEngraveLine10
End If
If Len(txtEngraveLine11) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 11) " & txtEngraveLine11
End If
If Len(txtEngraveLine12) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 12) " & txtEngraveLine12
End If


     If txtPlaque1 = "" AND txtInstructions3 <> "Type instructions here." then
           txtPlaque1 = "NO ENGRAVING TEXT ENTERED - ONLY INSTRUCTIONS:" & txtInstructions3
           intLineCount1 = 1
End If

If txtPlaque1 <> "" AND txtPlaque1 <> "-" AND intLineCount1 > 0 Then
 If txtInstructions3 <> "Type instructions here." AND txtInstructions3 <> "" Then
	 aryLocalCart(6,intItemNumber) = txtPlaque1 & " {[" & txtInstructions3 & "]}" 
 Else 
	 aryLocalCart(6,intItemNumber) = txtPlaque1
 End If
 If txtBlackOxidize = "ON" Then
	 aryLocalCart(5,intItemNumber) = "Black Oxidized, " & txtFontPlaque
	 aryLocalCart(8,intItemNumber) = 10.00 + (1.00 * intLineCount1)	
 Else
	 aryLocalCart(5,intItemNumber) = txtFontPlaque
	 aryLocalCart(8,intItemNumber) = 9.00 + (1.00 * intLineCount1)	
 End If
Else
 aryLocalCart(5,intItemNumber) = ""
 aryLocalCart(6,intItemNumber) = ""
End If


End If

If txtEngraveCode = "2P" Then

txtBlackOxidize = Request.Form("blackoxidize")
txtEngraveLine1 = Trim(Request.Form("engraveline1"))
txtEngraveLine2 = Trim(Request.Form("engraveline2"))
txtEngraveLine3 = Trim(Request.Form("engraveline3"))
txtEngraveLine4 = Trim(Request.Form("engraveline4"))
txtEngraveLine5 = Trim(Request.Form("engraveline5"))
txtEngraveLine6 = Trim(Request.Form("engraveline6"))
txtEngraveLine7 = Trim(Request.Form("engraveline7"))
txtEngraveLine8 = Trim(Request.Form("engraveline8"))
txtEngraveLine9 = Trim(Request.Form("engraveline9"))
txtEngraveLine10 = Trim(Request.Form("engraveline10"))
txtEngraveLine11 = Trim(Request.Form("engraveline11"))
txtEngraveLine12 = Trim(Request.Form("engraveline12"))
txtEngraveLine13 = Trim(Request.Form("engraveline13"))
txtEngraveLine14 = Trim(Request.Form("engraveline14"))
txtEngraveLine15 = Trim(Request.Form("engraveline15"))
txtEngraveLine16 = Trim(Request.Form("engraveline16"))
txtEngraveLine17 = Trim(Request.Form("engraveline17"))
txtEngraveLine18 = Trim(Request.Form("engraveline18"))
txtEngraveLine19 = Trim(Request.Form("engraveline19"))
txtEngraveLine20 = Trim(Request.Form("engraveline20"))
txtEngraveLine21 = Trim(Request.Form("engraveline21"))
txtEngraveLine22 = Trim(Request.Form("engraveline22"))
txtEngraveLine23 = Trim(Request.Form("engraveline23"))
txtEngraveLine24 = Trim(Request.Form("engraveline24"))


txtInstructions3 = Trim(Request.Form("instructions3"))
txtInstructions4 = Trim(Request.Form("instructions4"))

intLineCount1 = 0
If Len(txtEngraveLine1) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = "1) " & txtEngraveLine1
End If
If Len(txtEngraveLine2) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 2) " & txtEngraveLine2
End If
If Len(txtEngraveLine3) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 3) " & txtEngraveLine3
End If
If Len(txtEngraveLine4) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 4) " & txtEngraveLine4
End If
If Len(txtEngraveLine5) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 5) " & txtEngraveLine5
End If
If Len(txtEngraveLine6) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 6) " & txtEngraveLine6
End If
If Len(txtEngraveLine7) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 7) " & txtEngraveLine7
End If
If Len(txtEngraveLine8) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 8) " & txtEngraveLine8
End If
If Len(txtEngraveLine9) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 9) " & txtEngraveLine9
End If
If Len(txtEngraveLine10) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 10) " & txtEngraveLine10
End If
If Len(txtEngraveLine11) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 11) " & txtEngraveLine11
End If
If Len(txtEngraveLine12) > 0 Then
 intLineCount1 = intLineCount1 + 1
 txtPlaque1 = txtPlaque1 & " 12) " & txtEngraveLine12
End If



intLineCount2 = 0
If Len(txtEngraveLine13) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 1) " & txtEngraveLine13
End If
If Len(txtEngraveLine14) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 2) " & txtEngraveLine14
End If
If Len(txtEngraveLine15) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 3) " & txtEngraveLine15
End If
If Len(txtEngraveLine16) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 4) " & txtEngraveLine16
End If
If Len(txtEngraveLine17) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 5) " & txtEngraveLine17
End If
If Len(txtEngraveLine18) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 6) " & txtEngraveLine18
End If
If Len(txtEngraveLine19) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 7) " & txtEngraveLine19
End If
If Len(txtEngraveLine20) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 8) " & txtEngraveLine20
End If
If Len(txtEngraveLine21) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 9) " & txtEngraveLine21
End If
If Len(txtEngraveLine22) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 10) " & txtEngraveLine22
End If
If Len(txtEngraveLine23) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 11) " & txtEngraveLine23
End If
If Len(txtEngraveLine24) > 0 Then
 intLineCount2 = intLineCount2 + 1
 txtPlaque2 = txtPlaque2 & " 12) " & txtEngraveLine24
End If

     If txtPlaque1 = "" AND txtInstructions3 <> "Type instructions here." then
           txtPlaque1 = "NO ENGRAVING TEXT ENTERED - ONLY INSTRUCTIONS:" & txtInstructions3
           intLineCount1 = 1
End If

If txtPlaque1 <> "" AND txtPlaque1 <> "-" AND intLineCount1 > 0 Then
 If txtInstructions3 <> "Type instructions here." AND txtInstructions3 <> "" Then
	 aryLocalCart(6,intItemNumber) = txtPlaque1 & " {[" & txtInstructions3 & "]}" 
 Else 
	 aryLocalCart(6,intItemNumber) = txtPlaque1
 End If
 If txtBlackOxidize = "ON" Then
	 aryLocalCart(5,intItemNumber) = "Black Oxidized, " & txtFontPlaque
	 aryLocalCart(8,intItemNumber) = 10.00 + (1.00 * intLineCount1)	
 Else
	 aryLocalCart(5,intItemNumber) = txtFontPlaque
	 aryLocalCart(8,intItemNumber) = 9.00 + (1.00 * intLineCount1)	
 End If
Else
 aryLocalCart(5,intItemNumber) = ""
 aryLocalCart(6,intItemNumber) = ""
End If

     If txtPlaque2 = "" AND txtInstructions4 <> "Type instructions here." then
           txtPlaque2 = "NO ENGRAVING TEXT ENTERED - ONLY INSTRUCTIONS: " & txtInstructions4 
           intLineCount2 = 1
End If

If txtPlaque2 <> "" AND txtPlaque2 <> "-" AND intLineCount2 > 0 Then
 If txtInstructions4 <> "Type instructions here." AND txtInstructions4 <> "" Then
	 aryLocalCart(7,intItemNumber) = txtPlaque2 & " {[" & txtInstructions4 & "]}" 
 Else 
	 aryLocalCart(7,intItemNumber) = txtPlaque2
 End If
 If txtBlackOxidize = "ON" Then
	 aryLocalCart(5,intItemNumber) = "Black Oxidized, " & txtFontPlaque
	 aryLocalCart(8,intItemNumber) = aryLocalCart(8,intItemNumber) + 10.00 + (1.00 * intLineCount2)	
 Else
	 aryLocalCart(5,intItemNumber) = txtFontPlaque
	 aryLocalCart(8,intItemNumber) = aryLocalCart(8,intItemNumber) + 9.00 + (1.00 * intLineCount2)	
 End If
Else
 aryLocalCart(7,intItemNumber) = ""
End If	

End If

' ----- end collect info and compute plaque engraving fee -----

Session("Cart") = aryLocalCart 

Response.Redirect "cart.asp"
'Response.Redirect Session("RefererPage")

%>
<html>

<head>
<title>Add Engraving to Cart</title>
<meta name="Pragma" content="no-cache">
<base target="_self">
<meta NAME="robots" CONTENT="noindex, nofollow">
</head>

<body BGCOLOR="#FFFFFF" topmargin="0" leftmargin="0">
<!--#INCLUDE FILE="adovbs.inc"-->

<font face="Arial" size="2"> </font>

</body>
</html>

 

That is all the code to make this page

http://www.antiquesextant.com/asp/addengra...s&engravecode=E

 

Here is the problem...

 

If you go and say you want

 

"G G G" engraved it will charge you $11.20, this is correct as

$10(setup fee)+$.40 per charater for the first 30characters

 

now if you type in

 

"G

G

G"

using carrage return-linefeeds (hit enter)

 

it charges like $12.80

 

because it thinks a carrage return-linefeed is a character, in that page it is set to ignore spaces but not Vbcrlfs (carrage return-linefeed).

This only needs to be changed for Engrave Code E, D 2E and 2D

 

I think i found the part in the code where it subtracts the spaces using " "... i tryed doing

" " & VbCrLf but that didnt work....anyway here is the code where i think it is, thanks in advance

 

txtDirectEngraving1 = Trim(Request.Form("directengraving1"))
strSearchFor = " "
aryDirectEngraving1 = Split(txtDirectEngraving1,strSearchFor)
intLengthEngraving1 = Len(txtDirectEngraving1) - UBound(aryDirectEngraving1)


txtDirectEngraving2 = Trim(Request.Form("directengraving2"))
strSearchFor = " "
aryDirectEngraving2 = Split(txtDirectEngraving2,strSearchFor)
intLengthEngraving2 = Len(txtDirectEngraving2) - UBound(aryDirectEngraving2)

Share this post


Link to post
Share on other sites

Would " " & vbCrLf not be looking for `G \r\n` or \n or \r or whatever it is? I'll use underscores for spaces.. and \n for the new line

 

If you had

 

G

G

 

It'd be looking for

 

G_\n

G

 

Rather than what you want, which is..

 

G\n

G

 

Yeah? Maybe? Try "" &vbCrLf or just vbCrLf on its own?

Share this post


Link to post
Share on other sites

so

 

txtDirectEngraving1 = Trim(Request.Form("directengraving1"))
strSearchFor = " " & "" and VBcrlf
aryDirectEngraving1 = Split(txtDirectEngraving1,strSearchFor)
intLengthEngraving1 = Len(txtDirectEngraving1) - UBound(aryDirectEngraving1)


txtDirectEngraving2 = Trim(Request.Form("directengraving2"))
strSearchFor = " " & "" and VBcrlf
aryDirectEngraving2 = Split(txtDirectEngraving2,strSearchFor)
intLengthEngraving2 = Len(txtDirectEngraving2) - UBound(aryDirectEngraving2)

 

I did try

 

strSearchFor = vbcrlf

 

just to see what would happen no luck

Share this post


Link to post
Share on other sites

Well, I actually meant something like

 

strSearchFor = "" & vbCrLf

 

or

 

strSearchFor = vbCrLf

 

If you tried the second one though I doubt it's what I was thinking of. It was just a brief look though, maybe i'll take a better look at it now :)

 

EDIT: What are txtDirectEngraving1 and 2? Is this just the text to be engraved that the user has put in? That part looks to me like it would be doing per word rather than per character, unless each character happened to be seperated by a space.. like in your example G G G.

 

Sorry, too much code to read... bit too tired right now :)

 

Wouldn't you want to go through the string, remove all the spaces in the string... and new lines..and any other funny characters you might encounter, then get the size of the string? Or.. you could count how many spaces and new lines there are in the string and deduct it from the total.

 

Maybe i'm just missing something!

 

EDIT2: Upon further reading, I can see that what you're doing is searching for the spaces using arrays and getting the string length and subtracting this. Very sorry :)

 

So, would you not want something along the lines of..

 

<%

 

Edited by markiemrboo

Share this post


Link to post
Share on other sites

Well, I actually meant something like

 

strSearchFor = "" & vbCrLf

 

or

 

strSearchFor = vbCrLf

 

If you tried the second one though I doubt it's what I was thinking of. It was just a brief look though, maybe i'll take a better look at it now :)

 

EDIT: What are txtDirectEngraving1 and 2? Is this just the text to be engraved that the user has put in? That part looks to me like it would be doing per word rather than per character, unless each character happened to be seperated by a space.. like in your example G G G.

 

Sorry, too much code to read... bit too tired right now :)

 

Wouldn't you want to go through the string, remove all the spaces in the string... and new lines..and any other funny characters you might encounter, then get the size of the string? Or.. you could count how many spaces and new lines there are in the string and deduct it from the total.

 

Maybe i'm just missing something!

 

EDIT2: Upon further reading, I can see that what you're doing is searching for the spaces using arrays and getting the string length and subtracting this. Very sorry :)

 

So, would you not want something along the lines of..

 

<%

 

Share this post


Link to post
Share on other sites

i see where you are going...

 

But listen

 

Directengrave1 = when product can be engraved on 1 side

ex: http://www.antiquesextant.com/compminers.htm

 

directengrave2 = when it can be engraved one both sides

ex: http://www.antiquesextant.com/compforestry.htm

 

Its hard for me to look at your code because you have the <% :P

they are confusing me... i know it will make the page long, but copy and past your code into the orignal full code so i can just put it in and try it... and perhaps point out waht you did...

btw i also tryed

 

txtDirectEngraving1 = Trim(Request.Form("directengraving1"))
strSearchFor = " " & chr$(13) and chr$(10) 
aryDirectEngraving1 = Split(txtDirectEngraving1,strSearchFor)
intLengthEngraving1 = Len(txtDirectEngraving1) - UBound(aryDirectEngraving1)


txtDirectEngraving2 = Trim(Request.Form("directengraving2"))
strSearchFor = " " & chr$(13) and chr$(10) 
aryDirectEngraving2 = Split(txtDirectEngraving2,strSearchFor)
intLengthEngraving2 = Len(txtDirectEngraving2) - UBound(aryDirectEngraving2)

that didnt work either... soo idk i am about to give up but my boss keeps crapin about it... I tryed all that before i posted this... but your code above looks good

Share this post


Link to post
Share on other sites

lol

 

So you want me to drop my code snippet type thing into your script from the first post, correct? If so, reply and i'll post that so you can try.

 

By the way, as far as I am aware you cant use a logical operator on strings like that :) Or atleast.. i've never seen it done before.

Share this post


Link to post
Share on other sites

lol

 

So you want me to drop my code snippet type thing into your script from the first post, correct? If so, reply and i'll post that so you can try.

 

By the way, as far as I am aware you cant use a logical operator on strings like that :) Or atleast.. i've never seen it done before.

Yes.

 

and

 

I know, your right which is why i said it doesnt work :)

Share this post


Link to post
Share on other sites

lol obviously!

 

Well, here you go then. It doesn't do much for me, obviously, as I don't have any form or anything to test it with. See if this works for you.

 

EDIT: Oops, left a _1 in. This one should be right...

 

<%@ LANGUAGE="VBSCRIPT" %>

<% Response.Expires = 0

'Response.CacheControl = "no-cache"

Response.ExpiresAbsolute = Now()- 1000

 

'On Error Resume Next

txtEngraveCode = Request.Form("engravecode")

 

If txtEngraveCode = "2E" Then

If Request.Form("font2") = "-" Then

Dim txtEngraveCode

txtEngraveCode = "E"

End If

End If

 

If txtEngraveCode = "2P" Then

If Request.Form("fontplaque2") = "-" Then

txtEngraveCode = "P"

End If

End If

 

 

If txtEngraveCode = "2D" Then

If Request.Form("font2") = "-" Then

txtEngraveCode = "D"

End If

End If

 

Dim txtFontPlaque

If txtEngraveCode = "2P" Then

txtFontPlaque = Request.Form("fontplaque") & "/" & Request.Form("fontplaque2")

Else

txtFontPlaque = Request.Form("fontplaque")

End If

Dim txtFont

If txtEngraveCode = "2E" Then

txtFont = Request.Form("font") & "/" & Request.Form("font2")

Edited by markiemrboo

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...