Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Listings Manager (Realty Manager & Auto Manager):
Hidden Fields Issue

 

 


jarvis
User

Mar 6, 2009, 7:19 AM

Post #1 of 3 (2025 views)
Shortcut
Hidden Fields Issue Can't Post

Hi all,

I'm going mad!! I simply want to say if a field is blank, don't display the information. So, the following should be right:

Code
 <script type="text/javascript">  

var strvalue = "$lfield38$";
if(strvalue!="") {
document.write('<table border=0 width=100% cellspacing=0 cellpadding=2');
document.write('<tr>');
document.write('<td bgcolor="#EEEEEE"><b>&nbsp;Property Overview</b></td>');
document.write('</tr>');
document.write('</table>');
document.write('<p class="maintext">$lfield38$</p>');
}
</script>

Ideally & for neatness, I think the following should work & be correct but neither function!

Code
 <script type="text/javascript">  

if($lfield38$!="") {
document.write('<table border=0 width=100% cellspacing=0 cellpadding=2');
document.write('<tr>');
document.write('<td bgcolor="#EEEEEE"><b>&nbsp;Property Overview</b></td>');
document.write('</tr>');
document.write('</table>');
document.write('<p class="maintext">$lfield38$</p>');
}
</script>



jarvis
User

Mar 6, 2009, 7:20 AM

Post #2 of 3 (2024 views)
Shortcut
Re: [jarvis] Hidden Fields Issue [In reply to] Can't Post

Any help is much appreciated!



Many thanks,

jarvis


ross
Staff / Moderator


Mar 6, 2009, 11:21 AM

Post #3 of 3 (2000 views)
Shortcut
Re: [jarvis] Hidden Fields Issue [In reply to] Can't Post

Hi Jarvis

Thanks for posting!

First thing here is that you'll probably want to us:

$lfield38_je$

That little moddifier makes things work better if you are using the values in JavaScript.

Next, for this bit:

if($lfield38$!="")

Could you try:

if("$lfield38$" != "")

An even more organized way would be:

if("$lfield38$")

but the last two are both the same.

I think that should get you going. The way you had it before, the JavaScript was trying to use your placeholder as JavaScript variable. Putting the quotes around tells it to evaluate that as a string.

Give it a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - 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: http://www.interactivetools.com/consulting/