Jump to content
  • 0
dasigrist

Hiding an empty field.

Question

Hi Gurus, 
I have this business directory working in Wordpress + Avada Theme. Now we are moving to DIVI theme and some things are not working. I have this tabular report that shows all the offices for the specific company that was select. In the "Search and Report Wizard - Configure Results Page Fields" part I have this javascript to hide the fields that are blank:

<script>
if("[@field:Address]".length > 0){
document.write('<strong>Address:</strong> [@field:Address]<br />')
}
if("[@field:City]".length > 0){
document.write('<strong>City:</strong> [@field:City] ')
}
if("[@field:State]".length > 0){
document.write('<strong>State:</strong> [@field:State] ')
}
if("[@field:ZIP]".length > 0){
document.write('<strong>ZIP:</strong> [@field:ZIP]<br />')
}
if("[@field:Country]".length > 0){
document.write('<strong>Country:</strong> [@field:Country]')
}
</script>

it works very nice in AVADA:
image.thumb.png.9fec23f104cdb9f7d53f5edf634f38f6.png

 but it's not working in DIVI: 

image.png.23b083a9f407be880079341376175247.png


I also tried also this technique: 

but no success again.

Can someone help? 
thank you very much for any clues. 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi Kristina,

 

Thank you for answering, but it didn't work. I modified the code that shows the address to:image.png.51babbb961e22c363113f445fbce434d.png

 

and put the code in the footer as stated in the link you sent:

image.png.b7f192e9080a47ff4bc392b9e98c7874.png

But the datapage still shows the empty field "State":

image.png.08474b6cb2de415c586509ffed4f6c09.png

Any other suggestions?

 

thank you.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...