Home | Products | Consulting | Hosting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Listings Manager (Realty Manager & Auto Manager):
question about hiding field that are empty....

 

 


phendyr
User

Jun 16, 2008, 7:51 AM

Post #1 of 2 (581 views)
Shortcut
question about hiding field that are empty.... Can't Post

I recently found this javascript while searching on ways to hide empty fields:

<script type="text/javascript">
if ('$lfieldX$')
{
document.write("Fax:");
}
</script>


I was hoping someone could answer this question - I have a text field setup to enter a URL in the hompeage editor. I then use this code on the page to display the link:

<a target="_blank" href="$hfield8$">view my website</a>

Is it possible to wrap that javascript around this href tag so that if there is no URL entered, it does not display this field?

Thanks in advance.


MikeB
Staff / Moderator


Jun 16, 2008, 1:47 PM

Post #2 of 2 (548 views)
Shortcut
Re: [phendyr] question about hiding field that are empty.... [In reply to] Can't Post

Hi phendyr,

Thanks for posting! Smile

You could definitely set this up and to do this you'd just use some JavaScript that looks like this:


Code
<script type="text/javascript"> 
if ('$hfield8$')
{
document.write('<a target="_blank" href="$hfield8$">view my website</a>');
}
</script>


With this code, if hfield8 has a value then the "view my website" link will be displayed on the site. If this field is left blank no link will be displayed.

I hope this helps! Smile

Cheers,
Mike Briggs - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Hosting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4