HighDots Forums  

Selectively displaying dynamic text

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Selectively displaying dynamic text in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
megajam02
 
Posts: n/a

Default Selectively displaying dynamic text - 08-03-2004 , 09:49 AM






Ok, this has been driving me nuts for a couple of days.

Lets say, for example the I have 4 columns in my recordset -

id, event_name, event_location, event_charge

Now, I want to query the table and display the records with dynamic text on a
page like so:

Event Name: User Group Meeting
Event Location: Hawaii
Event Charge: $100

If there is no value in the event_charge field, I'd like to not display either
the value or the label on the page, because it's just not needed. I have been
able to figure out how to not show the entire row if something is blank, but
can you point me in the correct direction for not showing a particluar column
of a row. Oh, and I'm using PHP.

Does this make sense?

Thanks,
Chris


Reply With Quote
  #2  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Selectively displaying dynamic text - 08-03-2004 , 10:36 AM






Test the field, and only write the label and value if it's not empty.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"megajam02" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Ok, this has been driving me nuts for a couple of days.

Lets say, for example the I have 4 columns in my recordset -

id, event_name, event_location, event_charge

Now, I want to query the table and display the records with dynamic text
on a
page like so:

Event Name: User Group Meeting
Event Location: Hawaii
Event Charge: $100

If there is no value in the event_charge field, I'd like to not display
either
the value or the label on the page, because it's just not needed. I have
been
able to figure out how to not show the entire row if something is blank,
but
can you point me in the correct direction for not showing a particluar
column
of a row. Oh, and I'm using PHP.

Does this make sense?

Thanks,
Chris




Reply With Quote
  #3  
Old   
megajam02
 
Posts: n/a

Default Re: Selectively displaying dynamic text - 08-03-2004 , 02:18 PM



Murray,
I'm fairly new to php. Well, let me be honest. I'm new to web development in
general.

Can you give me some sample code? I'm not sure what you mean by testing the
field. I'm assuming an if/else statement? I am a bit familiar with that,
however, I'm not familiar with how to display the field and label only if the
value is empty.


Reply With Quote
  #4  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Selectively displaying dynamic text - 08-03-2004 , 07:06 PM



mega:

I don't do php, but here is ASP VBScript kinda pseudo-code (assuming your
label and your value are in adjacent table cells)...

<% if fieldname.value<>"" %>
<td>Label</td>
<td><%= fieldname.value %></td>
<% else %>
<td>&nbsp;</td><td>&nbsp;</td>
<% end if %>

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"megajam02" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Murray,
I'm fairly new to php. Well, let me be honest. I'm new to web development
in
general.

Can you give me some sample code? I'm not sure what you mean by testing
the
field. I'm assuming an if/else statement? I am a bit familiar with that,
however, I'm not familiar with how to display the field and label only if
the
value is empty.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.