tricky embedded[showifs/hideifs] (w/ code.. long)

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 27611
interpreted = N
texte = Got a tricky one (in my head anyway).Client wants a checkbox for NET30 customers that bypasses the need to enter a credit card. Fine. I created a checkbox with name 'net30' on the invoice.tpl page (based on StoreBuilder temps of course).I carry to value of 'net30' checkbox to the thanks.tpl page (verified with [formvariables]). Now I want to have _all_ the checksuming and other credit card info on thanks.tpl hidden and just process the order without that info needed for 'net30' customers. No matter _what_ I try I'm losing the display right after a table cell near the top. I've tried many different techniques over the last few hours, but it's alway dying at the same table cell (yes I've flushed template caches etc.)So then what could be wrong with the following code (reference http://makingtracks.net/mktrackswhole/index2.tpl with username: wholesale, password: mktracks and place a dummy order and you'll see the death of the thanks.tpl page (all the info goes to me right now)).thanks.tpl:[include file=header.inc]
[!] [include file=nav.inc] Not needed in this page to protect against already submitted carts [/!] [!] This is where the code dies all the time. [/!][!]Begin error checking code (worked fine before)[/!][text]flag=f[/text][ShowIf [__Company]=]

Please go back one and fill in the Company field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__Name]=]

Please go back one and fill in the Name field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__Email]=]

Please go back one and fill in the Email field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__Address1]=]

Please go back one and fill in the Address field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__City]=]

Please go back one and fill in the City field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__Zip]=]

Please go back one and fill in the Zip field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__State]=]

Please go back one and select a state.

[text]flag=t[/text] [/ShowIf][hideif [flag]=t] [setheader cart=[cart]][formvariables name=__&exact=F][getchars start=3][name][/getchars]=[url][value][/url]&[/formvariables][/setheader] [!] Want to start hiding CC code here [/!] [hideif [net30]=checkbox][orderfile cart=[cart]][setheader cart=[cart]]payMethod=CC[/setheader][math show=f]creditOK=1[/math][showif [validcard accountNum=[accountNum]&card=[listwords words=[lookup db=admin/prefs.db&lookinfield=pref&value=CREDIT_CARDS&returnfield=value]&delimiters=[url]+ [/url]][lookup db=admin/cards.db&lookinfield=CC_ID&value=[word]&returnfield=CC_ABRV]+[/listwords]]=F][math show=f]creditOK=0[/math]Please re-enter your credit card number. The number you entered may have a mistyped number or may be missing digits.

Credit Card
Card Number
Expiration
[/showif][/orderfile][/hideif] [!] End of the first [net30] hide [/!][!] Second [net30] hide [/!] [hideif [net30]=checkbox][showif [math]creditOK[/math]=1][/hideif] [orderfile cart=[cart]]Thanks For Purchasing

Your credit card will be charged at the time of shipment.You will be notified if there are any problems charging your card.

This page is your final receipt.[hideif [email]=] A copy will be emailed to [email].[/hideif] For a printed record use your web browsers 'print' command. Please note the order number on any correspondence. If you have any questions about your order contact [lookup db=./admin/prefs.db&lookinfield=pref&value=STORE_EMAIL&returnfield=value].
[!]Set the TextA-TextE fields[/!] [text]shopcart=[cart][/text] [lineitems] [search db=./admin/carts.db&neCARTdatarq=find_all&rank=off][founditems][hideif [interpret][text[CART]][/interpret]=] [search db=./admin/related.db&eqR_IDdatarq=[interpret][text[CART]][/interpret]][founditems][setlineitem db=./admin/categories.db&index=[lineindex]&cart=[shopcart]]text[CART]=[url][R_NAME][/url][/setlineitem][/founditems][/search] [/hideif] [/founditems][/search] [/lineitems]
Order Number [cart]
Ship To
[shiptocompany]
[shiptoname]
[shiptoaddress1]
[showif [shiptoaddress]!][shiptoaddress2]
[/showif] [shiptoCity], [shiptostate] [shiptozip]
[showif [shiptoCountry]!][shiptoCountry]
[/showif] [showif [shiptoemail]!][shiptoemail][/showif]

Bill To

[company]
[name]
[address1]
[showif [address]!][address2]
[/showif] [City], [state] [zip]
[showif [Country]!][Country]
[/showif] [showif [email]!][email][/showif]

 

[lineItems] [/lineItems] $[subTotal][showif [lookup db=./admin/prefs.db&lookinfield=pref&value=SHIP_TAX&returnfield=value¬found=F]=F] [/showif][showif [lookup db=./admin/prefs.db&lookinfield=pref&value=SHIP_TAX&returnfield=value¬found=F]=T] [/showif]$[subTotal]+added
SKUProductQtyPriceTotal
[SKU][lookup db=./admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=TITLE] [search db=./admin/carts.db&neCARTdatarq=find_all&rank=off][founditems][hideif [interpret][text[CART]][/interpret]=] [search db=./admin/related.db&eqR_IDdatarq=[interpret][text[CART]][/interpret]][founditems][lookup db=./admin/categories.db&lookinfield=C_ID&value=[R_CATEGORY]&returnfield=C_NAME]:[R_NAME][/founditems][/search] [/hideif] [/founditems][/search] [quantity][lookup db=./admin/prefs.db&lookinfield=pref&value=CURRENCY&returnfield=value][price][lookup db=admin/prefs.db&lookinfield=pref&value=CURRENCY&returnfield=value][format .[lookup db=./admin/prefs.db&lookinfield=pref&value=CURRENCY_ACCURACY&returnfield=value]f][math][quantity]*[price][/math][/format]
Sub Total
Tax Rate:[taxRate]% Tax$[taxTotal]
Shipping & Handlingadded
Shipping & Handlingadded
Tax Rate:[taxRate]% Tax$[taxTotal]
Grand Total
[!]--This sends the information via email if we were not using WebMerchant--[/!] [hideif [email]=] [sendmail to=[url][email][/url]&from=[url][lookup db=./admin/prefs.db&lookinfield=pref&value=STORE_EMAIL&returnfield=value][/url]&subject=Wholesale Receipt from Making Tracks Inc.] Order Number [cart] Ship To [shiptocompany] [shiptoname] [shiptoaddress1] [shiptoaddress2] [shiptoCity], [shiptostate] [shiptozip] [shiptoCountry] [shiptoemail]Bill To [company] [name] [address1] [address2] [City], [state] [zip] [Country] [email]SKU Product Qty Price ($) Total ($) __________|________________________________________|______|__________|__________[lineItems][format 10s][sku][/format] [format 20s][lookup db=./admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=TITLE][/format][format 20s][search db=./admin/carts.db&neCARTdatarq=find_all&rank=off][founditems][hideif [interpret][text[CART]][/interpret]=][search db=./admin/related.db&eqR_IDdatarq=[interpret][text[CART]][/interpret]][founditems][lookup db=./admin/categories.db&lookinfield=C_ID&value=[R_CATEGORY]&returnfield=C_NAME]:[R_NAME][/founditems][/search][/hideif][/founditems][/search][/format] [format 6.0f][quantity][/format] [format 10.2f][price][/format] [format 10.2f][math][quantity]*[price][/math][/format] [/lineitems]________________________________________________________________________________ Sub Total: [format 10.2f][subTotal][/format] [showif [taxableshipping]=F] Tax Rate:[taxRate]% Tax: [format 10.2f][taxTotal][/format] Shipping & Handling: [format 10.2f]added[/format][/showif][showif [taxableshipping]=T] Shipping & Handling: [format 10.2f]added[/format] Tax Rate: [format 6.2f][taxRate][/format]% Tax: [format 10.2f][taxTotal][/format][/showif]_______________________Grand Total: [subTotal]+added [/sendmail] [/hideif][sendmail to=[url][lookup db=./admin/prefs.db&lookinfield=pref&value=STORE_EMAIL&returnfield=value][/url]&from=[url][lookup db=./admin/prefs.db&lookinfield=pref&value=STORE_EMAIL&returnfield=value][/url]&subject=Wholesale Order] Order Number [cart] Ship To [shiptocompany] [shiptoname] [shiptoaddress1] [shiptoaddress2] [shiptoCity], [shiptostate] [shiptozip] [shiptoCountry]Bill To [company] [name] [address1] [address2] [City], [state] [zip] [Country]Credit Card Due to security please final process this order at: http://makingtracks.net/mktrackswhole/vieworder.tpl?cart=[cart]SKU Product Qty Price ($) Total ($) __________|________________________________________|______|__________|__________[lineItems][format 10s][sku][/format] [format 20s][lookup db=./admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=TITLE][/format][format 20s][search db=admin/carts.db&neCARTdatarq=find_all&rank=off][founditems][hideif [interpret][text[CART]][/interpret]=][search db=./admin/related.db&eqR_IDdatarq=[interpret][text[CART]][/interpret]][founditems][lookup db=./admin/categories.db&lookinfield=C_ID&value=[R_CATEGORY]&returnfield=C_NAME]:[R_NAME][/founditems][/search][/hideif][/founditems][/search][/format] [format 6.0f][quantity][/format] [format 10.2f][price][/format] [format 10.2f][math][quantity]*[price][/math][/format] [/lineitems]________________________________________________________________________________ Sub Total: [format 10.2f][subTotal][/format] [showif [taxableshipping]=F] Tax Rate:[taxRate]% Tax: [format 10.2f][taxTotal][/format] Shipping & Handling: [format 10.2f]added[/format][/showif][showif [taxableshipping]=T] Shipping & Handling: [format 10.2f]added[/format] Tax Rate: [format 6.2f][taxRate][/format]% Tax: [format 10.2f][taxTotal][/format][/showif]_______________________Grand Total: [subTotal]+added [/sendmail][/orderfile][purchase cart=[cart]] [!] Have to hide this to match [showif [math]creditOK[/math]=1] above [/!] [hideif [net30]=checkbox][/showif][/hideif]

Return to Making Tracks Inc. Wholesale Store.

[!] error correction end [/hideif] [/!] [/hideif]
End thanks.tpl.Thanks a lot. There is some nesting that just isn't working for me. -- Parker Zero Echo Inc. Content Director ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re: tricky embedded[showifs/hideifs] (w/ code.. long) (Kenneth Grome 2000)
  2. Re: tricky embedded[showifs/hideifs] (w/ code.. long) (Parker 2000)
  3. Re: tricky embedded[showifs/hideifs] (w/ code.. long) (Kenneth Grome 2000)
  4. Re: tricky embedded[showifs/hideifs] (w/ code.. long) (Parker 2000)
  5. Re: tricky embedded[showifs/hideifs] (w/ code.. long) (John Butler 2000)
  6. Re: tricky embedded[showifs/hideifs] (w/ code.. long) (Kenneth Grome 2000)
  7. Re: tricky embedded[showifs/hideifs] (w/ code.. long) (Parker 2000)
  8. Re: tricky embedded[showifs/hideifs] (w/ code.. long) (Kenneth Grome 2000)
  9. Re: tricky embedded[showifs/hideifs] (w/ code.. long) (WebDNA Support 2000)
  10. Re: tricky embedded[showifs/hideifs] (w/ code.. long) (John Butler 2000)
  11. tricky embedded[showifs/hideifs] (w/ code.. long) (Parker 2000)
Got a tricky one (in my head anyway).Client wants a checkbox for NET30 customers that bypasses the need to enter a credit card. Fine. I created a checkbox with name 'net30' on the invoice.tpl page (based on StoreBuilder temps of course).I carry to value of 'net30' checkbox to the thanks.tpl page (verified with [formvariables]). Now I want to have _all_ the checksuming and other credit card info on thanks.tpl hidden and just process the order without that info needed for 'net30' customers. No matter _what_ I try I'm losing the display right after a table cell near the top. I've tried many different techniques over the last few hours, but it's alway dying at the same table cell (yes I've flushed template caches etc.)So then what could be wrong with the following code (reference http://makingtracks.net/mktrackswhole/index2.tpl with username: wholesale, password: mktracks and place a dummy order and you'll see the death of the thanks.tpl page (all the info goes to me right now)).thanks.tpl:[include file=header.inc]
[!] [include file=nav.inc] Not needed in this page to protect against already submitted carts [/!] [!] This is where the code dies all the time. [/!][!]Begin error checking code (worked fine before)[/!][text]flag=f[/text][ShowIf [__Company]=]

Please go back one and fill in the Company field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__Name]=]

Please go back one and fill in the Name field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__Email]=]

Please go back one and fill in the Email field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__Address1]=]

Please go back one and fill in the Address field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__City]=]

Please go back one and fill in the City field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__Zip]=]

Please go back one and fill in the Zip field.

[text]flag=t[/text] [/ShowIf] [ShowIf [__State]=]

Please go back one and select a state.

[text]flag=t[/text] [/ShowIf][hideif [flag]=t] [setheader cart=[cart]][formvariables name=__&exact=F][getchars start=3][name][/getchars]=[url][value][/url]&[/formvariables][/setheader] [!] Want to start hiding CC code here [/!] [hideif [net30]=checkbox][orderfile cart=[cart]][setheader cart=[cart]]payMethod=CC[/setheader][math show=f]creditOK=1[/math][showif [validcard accountNum=[accountNum]&card=[listwords words=[lookup db=admin/prefs.db&lookinfield=pref&value=CREDIT_CARDS&returnfield=value]&delimiters=[url]+ [/url]][lookup db=admin/cards.db&lookinfield=CC_ID&value=[word]&returnfield=CC_ABRV]+[/listwords]]=F][math show=f]creditOK=0[/math]Please re-enter your credit card number. The number you entered may have a mistyped number or may be missing digits.

[cart]>
Credit Card
Card Number
Expiration
[/showif][/orderfile][/hideif] [!] End of the first [net30] hide [/!][!] Second [net30] hide [/!] [hideif [net30]=checkbox][showif [math]creditOK[/math]=1][/hideif] [orderfile cart=[cart]]Thanks For Purchasing

Your credit card will be charged at the time of shipment.You will be notified if there are any problems charging your card.

This page is your final receipt.[hideif [email]=] A copy will be emailed to [email].[/hideif] For a printed record use your web browsers 'print' command. Please note the order number on any correspondence. If you have any questions about your order contact [lookup db=./admin/prefs.db&lookinfield=pref&value=STORE_EMAIL&returnfield=value].
[!]Set the TextA-TextE fields[/!] [text]shopcart=[cart][/text] [lineitems] [search db=./admin/carts.db&neCARTdatarq=find_all&rank=off][founditems][hideif [interpret][text[cart]][/interpret]=] [search db=./admin/related.db&eqR_IDdatarq=[interpret][text[cart]][/interpret]][founditems][setlineitem db=./admin/categories.db&index=[lineindex]&cart=[shopcart]]text[cart]=[url][R_NAME][/url][/setlineitem][/founditems][/search] [/hideif] [/founditems][/search] [/lineitems]
Order Number [cart]
Ship To
[shiptocompany]
[shiptoname]
[shiptoaddress1]
[showif [shiptoaddress]!][shiptoaddress2]
[/showif] [shiptoCity], [shiptostate] [shiptozip]
[showif [shiptoCountry]!][shiptoCountry]
[/showif] [showif [shiptoemail]!][shiptoemail][/showif]

Bill To

[company]
[name]
[address1]
[showif [address]!][address2]
[/showif] [City], [state] [zip]
[showif [Country]!][Country]
[/showif] [showif [email]!][email][/showif]

 

[lineitems] [/lineItems] $[subTotal][showif [lookup db=./admin/prefs.db&lookinfield=pref&value=SHIP_TAX&returnfield=value¬found=F]=F] [/showif][showif [lookup db=./admin/prefs.db&lookinfield=pref&value=SHIP_TAX&returnfield=value¬found=F]=T] [/showif]$[subTotal]+added
SKUProductQtyPriceTotal
[SKU][lookup db=./admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=TITLE] [search db=./admin/carts.db&neCARTdatarq=find_all&rank=off][founditems][hideif [interpret][text[cart]][/interpret]=] [search db=./admin/related.db&eqR_IDdatarq=[interpret][text[cart]][/interpret]][founditems][lookup db=./admin/categories.db&lookinfield=C_ID&value=[R_CATEGORY]&returnfield=C_NAME]:[R_NAME][/founditems][/search] [/hideif] [/founditems][/search] [quantity][lookup db=./admin/prefs.db&lookinfield=pref&value=CURRENCY&returnfield=value][price][lookup db=admin/prefs.db&lookinfield=pref&value=CURRENCY&returnfield=value][format .[lookup db=./admin/prefs.db&lookinfield=pref&value=CURRENCY_ACCURACY&returnfield=value]f][math][quantity]*[price][/math][/format]
Sub Total
Tax Rate:[taxRate]% Tax$[taxTotal]
Shipping & Handlingadded
Shipping & Handlingadded
Tax Rate:[taxRate]% Tax$[taxTotal]
Grand Total
[!]--This sends the information via email if we were not using WebMerchant--[/!] [hideif [email]=] [sendmail to=[url][email][/url]&from=[url][lookup db=./admin/prefs.db&lookinfield=pref&value=STORE_EMAIL&returnfield=value][/url]&subject=Wholesale Receipt from Making Tracks Inc.] Order Number [cart] Ship To [shiptocompany] [shiptoname] [shiptoaddress1] [shiptoaddress2] [shiptoCity], [shiptostate] [shiptozip] [shiptoCountry] [shiptoemail]Bill To [company] [name] [address1] [address2] [City], [state] [zip] [Country] [email]SKU Product Qty Price ($) Total ($) __________|________________________________________|______|__________|__________[lineitems][format 10s][sku][/format] [format 20s][lookup db=./admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=TITLE][/format][format 20s][search db=./admin/carts.db&neCARTdatarq=find_all&rank=off][founditems][hideif [interpret][text[cart]][/interpret]=][search db=./admin/related.db&eqR_IDdatarq=[interpret][text[cart]][/interpret]][founditems][lookup db=./admin/categories.db&lookinfield=C_ID&value=[R_CATEGORY]&returnfield=C_NAME]:[R_NAME][/founditems][/search][/hideif][/founditems][/search][/format] [format 6.0f][quantity][/format] [format 10.2f][price][/format] [format 10.2f][math][quantity]*[price][/math][/format] [/lineitems]________________________________________________________________________________ Sub Total: [format 10.2f][subTotal][/format] [showif [taxableshipping]=F] Tax Rate:[taxRate]% Tax: [format 10.2f][taxTotal][/format] Shipping & Handling: [format 10.2f]added[/format][/showif][showif [taxableshipping]=T] Shipping & Handling: [format 10.2f]added[/format] Tax Rate: [format 6.2f][taxRate][/format]% Tax: [format 10.2f][taxTotal][/format][/showif]_______________________Grand Total: [subTotal]+added [/sendmail] [/hideif][sendmail to=[url][lookup db=./admin/prefs.db&lookinfield=pref&value=STORE_EMAIL&returnfield=value][/url]&from=[url][lookup db=./admin/prefs.db&lookinfield=pref&value=STORE_EMAIL&returnfield=value][/url]&subject=Wholesale Order] Order Number [cart] Ship To [shiptocompany] [shiptoname] [shiptoaddress1] [shiptoaddress2] [shiptoCity], [shiptostate] [shiptozip] [shiptoCountry]Bill To [company] [name] [address1] [address2] [City], [state] [zip] [Country]Credit Card Due to security please final process this order at: http://makingtracks.net/mktrackswhole/vieworder.tpl?cart=[cart]SKU Product Qty Price ($) Total ($) __________|________________________________________|______|__________|__________[lineitems][format 10s][sku][/format] [format 20s][lookup db=./admin/products.db&lookinfield=SKU&value=[url][sku][/url]&returnfield=TITLE][/format][format 20s][search db=admin/carts.db&neCARTdatarq=find_all&rank=off][founditems][hideif [interpret][text[cart]][/interpret]=][search db=./admin/related.db&eqR_IDdatarq=[interpret][text[cart]][/interpret]][founditems][lookup db=./admin/categories.db&lookinfield=C_ID&value=[R_CATEGORY]&returnfield=C_NAME]:[R_NAME][/founditems][/search][/hideif][/founditems][/search][/format] [format 6.0f][quantity][/format] [format 10.2f][price][/format] [format 10.2f][math][quantity]*[price][/math][/format] [/lineitems]________________________________________________________________________________ Sub Total: [format 10.2f][subTotal][/format] [showif [taxableshipping]=F] Tax Rate:[taxRate]% Tax: [format 10.2f][taxTotal][/format] Shipping & Handling: [format 10.2f]added[/format][/showif][showif [taxableshipping]=T] Shipping & Handling: [format 10.2f]added[/format] Tax Rate: [format 6.2f][taxRate][/format]% Tax: [format 10.2f][taxTotal][/format][/showif]_______________________Grand Total: [subTotal]+added [/sendmail][/orderfile][purchase cart=[cart]] [!] Have to hide this to match [showif [math]creditOK[/math]=1] above [/!] [hideif [net30]=checkbox][/showif][/hideif]

Return to Making Tracks Inc. Wholesale Store.

[!] error correction end [/hideif] [/!] [/hideif]
End thanks.tpl.Thanks a lot. There is some nesting that just isn't working for me. -- Parker Zero Echo Inc. Content Director ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Parker

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

[format xs] freeze (1997) WC2.0 Memory Requirements (1997) [WebDNA] WebDNA install on Redhat 4 64 bit? (2008) best way to test for the existence of a parameter in a url (2003) First postarg not taking in $Commands (1997) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) Shopping cart problem (2003) Snake Bites (1997) Help HTML reader (1999) Cache headers - WebDNA 5 (2005) WC2.0 Memory Requirements (1997) BGcolor (1997) Attn: Bug in GeneralStore example b15 (1997) absolute paths for databases? (1997) WebCat with WebTen (1998) (1997) Friendly , quick 'security' check, please (2003) European Convention (2004) WebDNA & HTML Problems (2003) Extended [ConvertChars] (1997)