navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

If then Else help

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> If then Else help
Page: [1]
 
99bird

 

Posts: 15
Joined: 3/19/2004
Status: offline

 
If then Else help - 11/17/2005 16:29:25   
I am trying to list a regular price (Price) and in some cases a sale price (spprice) for a item. If a sale price (spprice) is present I want to be able to show the regular price (Price) with a line through it (a stikethrough) and the sale price.
And if there is not a sale price (spprice), show just the regular price(Price). So far I have been able to get it to work using the If, Then, Else statement listed below with exception that when there is not a sale price the regular price still has a strikethrough it in all cases.
I think I have explained correctly.

Any help will be greatly appreciated.
Thanks for all your help in advance.

<% If (FP_FieldVal(fp_rs,"spprice")) > "" then %>
<font face="Verdana" size="2" color="#000000">
<strike><%=FP_FieldVal(fp_rs,"Price")%></strike>  <font face="Verdana" size="2" color="#FF0000"><%=FP_FieldVal(fp_rs,"spprice")%>
<%Else%>
<%=FP_FieldVal(fp_rs,"Price")%>
<% end IF %>
rdouglass

 

Posts: 9229
From: Biddeford, ME USA
Status: offline

 
RE: If then Else help - 11/17/2005 19:25:02   
quote:

<% If (FP_FieldVal(fp_rs,"spprice")) > "" then %>


It looks like your problem is using the "FP_FieldVal". That, by default will return a space if the field is Null or empty so it will *never* = "".

What we should do is use:

(FP_Field(fp_rs,"spprice")) 'Notice no 'Val'

and really ensure it will be empty by using trim like so:

<% If trim(FP_Field(fp_rs,"spprice")&"") > "" then %>

(the &"" is in there in case the DB returns a Null. Trim will error on Nulls)

That any help?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to 99bird)
99bird

 

Posts: 15
Joined: 3/19/2004
Status: offline

 
RE: If then Else help - 11/18/2005 8:32:00   
rdouglass,
That did it. Works perfectly. Thank you for you help.

(in reply to 99bird)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> If then Else help
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts