Blank Field Suppression (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


steveg -> Blank Field Suppression (2/25/2008 12:02:59)

I have DRW that shows prices from different suppliers.

I currently have doillar sign, an output field and an icon which links to the store locator for the company. e.g. $<<price>> iconlink.

Therefore all fields display a dollar sign and the icon link even though there is not content.

Any suggestions on how I should approach this?

Steve





rdouglass -> RE: Blank Field Suppression (2/25/2008 14:27:53)

Something like this maybe?

<%IF trim(FP_Field(fp_rs,"ItemPrice")&"") > "" THEN%>$<%=FP_Field(fp_rs,"ItemPrice")&"")%><%END IF%>

That would need to be in a Dieted DRW. That help any?





steveg -> RE: Blank Field Suppression (2/25/2008 14:41:50)

That looks like that might be in the direction of what I need. I will have a play and let you know.

Thanks for the quick response, as always![;)]




steveg -> RE: Blank Field Suppression (2/25/2008 15:22:24)

I changed the field name to fit mine so it read:-

<%IF trim(FP_FieldVal(fp_rs,"Meijer")&"")) > "" THEN%>$<%=FP_Field(fp_rs,"Meijer")&"")%><%END IF%>


When I tried that I got the following message:-

Microsoft VBScript compilation error '800a0401' 

Expected end of statement 

/4dollar/4dollar_search_copy(1).asp, line 247 

Response.Write(FP_Field(fp_rs,"Meijer")&""))
-------------------------------------------------------^


Steve




steveg -> RE: Blank Field Suppression (2/26/2008 3:48:06)

Also, does this imply that there will only be something displayed if the field is not blank/null, without the need to have an else element?

Steve




rdouglass -> RE: Blank Field Suppression (2/26/2008 8:51:48)

quote:

trim(FP_FieldVal(fp_rs,"Meijer")&""))


Looks like you have an extra paren in there. See it? The last one in that quote above?

<%IF trim(FP_Field(fp_rs,"Meijer")&"") > "" THEN%>

And I had an extra one in one of mine.[;)] Here's my revised version:

<%IF trim(FP_Field(fp_rs,"Meijer")&"") > "" THEN%>$<%=FP_Field(fp_rs,"Meijer")%><%END IF%>

quote:

Also, does this imply that there will only be something displayed if the field is not blank/null, without the need to have an else element?


Yup, that's what it's supposed to do.




steveg -> RE: Blank Field Suppression (2/29/2008 12:05:52)

Hey Roger

That worked great. I also added my store link into the expression and it's quite neat.

I now have a further problem and I am struggling to think of a way to approach it. If this should be a separate topic let me know and I will create it.

I have three fields which hold item information and then I have about 6 fields which hold pricing information from suppliers. It just fits on a page. I have now been given another 6 suppliers and told that there may be more!!!

I am happy to have the screen scroll right but I would like the 3 fields with the item information to remain visible so that the customer can remember which item they are looking at pricing details for.

Alternatively, can you think of a way that I can display all the fields relative to an item on the page while keeping things as simple as possible? The users will not be particularly computer literate. At the moment the search and display is fairly simple.

Cheers

Steve




rdouglass -> RE: Blank Field Suppression (2/29/2008 16:13:31)

Make fonts smaller? [;)]

I dunno'...probably has a huge amount to do with the application. As to scrolling horizontally, don't do it unless there's no other way.

Many times doing things in a vertical scroll is quite acceptable:

<div style="width: 100px; height: 80px; min-height: 80px; overflow-y: scroll;">
Put your text here, lots of it....
</div>

That should give you a 100px wide box 80 pix high that has scroll bars. That's a way I do it quite often. Hope it helps.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625