close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How do I Hide/show if field is empty in jQuery Script

Thread began 7/02/2013 1:20 pm by blakebenjamin327842 | Last modified 7/02/2013 5:52 pm by blakebenjamin327842 | 525 views | 10 replies |

blakebenjamin327842

How do I Hide/show if field is empty in jQuery Script

Below is a jQuery code for a product zoom. If the "ProductImage", "ProductLineArt", or "ProductLifestyle"are empty I want to hide the row of code it is listed in...

Please advise:

<a href="<?php echo $row_WADAproduct['ProductZoom']; ?>" class="MagicZoomPlus" id="Zoomer" title="<?php echo $row_WADAproduct['ProductName']; ?> Rug"><img src="<?php echo $row_WADAproduct['ProductImage']; ?>"/></a> <br/>
<a href="<?php echo $row_WADAproduct['ProductZoom']; ?>" rel="zoom-id:Zoomer" rev="<?php echo $row_WADAproduct['ProductImage']; ?>"><img src="<?php echo $row_WADAproduct['ProductSmall']; ?>"/></a>
<a href="<?php echo $row_WADAproduct['ProductLineArtZoom']; ?>" rel="zoom-id:Zoomer" rev="<?php echo $row_WADAproduct['ProductLineArt']; ?>"><img src="<?php echo $row_WADAproduct['ProductLineArtSm']; ?>"/></a>
<?php if($row__WADAproduct['ProductLifestyle'] != "") { ?>
<a href="<?php echo $row_WADAproduct['ProductLifestyleZoom']; ?>" rel="zoom-id:Zoomer" rev="<?php echo $row_WADAproduct['ProductLifestyle']; ?>"><img src="<?php echo $row_WADAproduct['ProductLifestyleSm']; ?>"/></a>
<?php } ?>

Sign in to reply to this post

Jason ByrnesWebAssist

use an if statement around each link, for example:

php:
<?php if($row_WADAproduct['ProductZoom'] == "") { ?>

<a href="<?php echo $row_WADAproduct['ProductZoom']; ?>" class="MagicZoomPlus" id="Zoomer" title="<?php echo $row_WADAproduct['ProductName']; ?> Rug"><img  src="<?php echo $row_WADAproduct['ProductImage']; ?>"/></a>  
<?php ?>
Sign in to reply to this post

blakebenjamin327842

I put in what you said and I'm getting a syntax error. Please review what i did.

Thank

Sign in to reply to this post

Jason ByrnesWebAssist

what is the exact error? it should include a line number.

also send a copy of the page.

Sign in to reply to this post

blakebenjamin327842

I just copied the code in again, there is no longer a syntax error, however everything is being hidden.

I attached the page. Thanks again

Sign in to reply to this post

Jason ByrnesWebAssist

I dont see anything obvious in the code.

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

blakebenjamin327842

Site info sent

Sign in to reply to this post

Jason ByrnesWebAssist

at lines 740 - 743:

php:
<?php if($row_WADAproduct['ProductZoom'] == "") { ?>

        <a href="<?php echo $row_WADAproduct['ProductZoom']; ?>" class="MagicZoomPlus" id="Zoomer"><img  src="<?php echo $row_WADAproduct['ProductImage']; ?>"/><?php ?></a> <br/>
<div id="Design_copyright">Copyright <?php echo $row_WADAproduct['CopyrightName']; ?></div><br /> 
<?php ?>



you have an extra closing bracket.

I removed line 743 to correct the problem.

Sign in to reply to this post

blakebenjamin327842

I made the same correction and re-uploaded the file.

Sign in to reply to this post

Jason ByrnesWebAssist

Originally Said By: blakebenjamin327842
  I made the same correction and re-uploaded the file.  
Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...