Professional Web Applications Themes

Show / Hide elements inside Repeat Region - Macromedia Dynamic HTML

I'm trying to show or hide dynamic text inside a repeat region for an online membership directory depending on whether or not there is a website in the website field for that particular member... My problem is that it only works for one record. For example if I search by last name, if only one row has a website listed it will show the region for all members in the repeat region... I will appreciate any help I can get on this very much!!! Please let me know if you need any more info George...

Sponsored Links
  1. #1

    Default Show / Hide elements inside Repeat Region

    I'm trying to show or hide dynamic text inside a repeat region for an online
    membership directory depending on whether or not there is a website in the
    website field for that particular member...

    My problem is that it only works for one record. For example if I search by
    last name, if only one row has a website listed it will show the region for all
    members in the repeat region...

    I will appreciate any help I can get on this very much!!! Please let me know
    if you need any more info

    George

    Sponsored Links
    o0knightro Guest

  2. #2

    Default Re: Show / Hide elements inside Repeat Region

    How are you identifying the elements? Are you using an ID value? Are you
    incrementing this value to prevent multiple instances of the same ID?

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    ==================


    "o0knightro" <com> wrote in message
    news:g3f97f$ns2$macromedia.com... 

    Murray Guest

  3. #3

    Default Re: Show / Hide elements inside Repeat Region

    Thank you, Murray for your response. I had a feeling that I did not provide
    enough info. Let me explain as best I can what I'm trying to accomplish.

    I'm working on a very simple online membership directory which I'm building w/
    Dreamweaver, PHP, and MySQL. On the search page I have several search criteria,
    but I'll use "Last Name" as an example. When you search by last name it passes
    the text as a url parameter "lastname" for the recordset on the results page.
    ID is the key value and I believe I have it as incremental. The members are
    displayed in a dynamic repeating table that I created with the DW server
    behaviors (DW CS3).

    What I want to do on dynamic table is hide the region where the website would
    be displayed if there is no website in that member's website field in the
    database. The problem is that the show hide server behavior only checks the
    first row I believe and applies the show/ hide for every member so if the first
    member did not have a website, none of the members in the table would have
    their website show up, but if the first member did have a website, that area
    would show for all members even if they didn't have a website. I hope that
    makes some sort of sense. I'm trying to show/ hide a region depending on the
    content of a field inside a repeating dynamic table.

    Please let me know if you need any further info. and I really appreciate the
    help.

    Thanks!

    George

    o0knightro Guest

  4. #4

    Default Re: Show / Hide elements inside Repeat Region

    You certainly wouldn't want to do that with show/hide.

    Paste here the code you are using in the repeat region to write that field's
    data into the page, please.

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    ==================


    "o0knightro" <com> wrote in message
    news:g3gbrf$1kv$macromedia.com... 

    Murray Guest

  5. #5

    Default Re: Show / Hide elements inside Repeat Region

    Okay, I'm sure this is ugly, so I feel like I need to say that I do not
    consider myself a good programmer at all. I'm just experimenting for an
    internal membership directory for my company...

    <?php do { ?>
    <tr>
    <td><table width="100%" border="1" cellpadding="0"
    cellspacing="0" bordercolor="#999999">
    <tr>
    <td><table width="100%" height="139" border="0"
    align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
    <tr>
    <td width="42" height="144" rowspan="5"
    align="left" valign="top" bgcolor="#999999" scope="col"><img src="<?php echo
    $row_lastname['Photo']; ?>" alt="." name="" border="0" style="background-color:
    #FF9900" /></td>
    <th height="20" colspan="4" align="center"
    valign="middle" bgcolor="#CCCCCC" class="GrayText1" scope="col">&nbsp;<?php
    echo $row_lastname['Name Calc']; ?></th>
    </tr>
    <tr>
    <td width="85" align="right" valign="middle"
    bgcolor="#FFFFFF" class="GrayText1">Phone:</td>
    <td width="131" align="left" valign="middle"
    bgcolor="#FFFFFF" class="GrayText1"><?php echo $row_lastname['Phone']; ?></td>
    <td width="38" align="right" valign="middle"
    bgcolor="#FFFFFF" class="GrayText1">Fax:</td>
    <td width="204" align="left" valign="middle"
    bgcolor="#FFFFFF" class="GrayText1"><?php echo $row_lastname['Fax']; ?></td>
    </tr>
    <tr>
    <td align="right" valign="middle"
    bgcolor="#FFFFFF" class="GrayText1">Email:</td>
    <td colspan="2" align="left" valign="middle"
    bgcolor="#FFFFFF" class="GrayText1"><?php echo $row_lastname['Email']; ?> </td>
    <td align="left" valign="middle"
    bgcolor="#FFFFFF" class="GrayText1"><a href="http://<?php echo
    $row_lastname['Website']; ?>" target="_blank" class="style73"></a></td>
    </tr>
    <tr>
    <td align="right" valign="middle"
    bgcolor="#FFFFFF" class="GrayText1">Website: </td>
    <td colspan="3" align="left" valign="middle"
    bgcolor="#FFFFFF" class="GrayText1"><a href="http://<?php echo
    $row_lastname['Website']; ?>" target="_blank" class="style73"><?php echo
    $row_lastname['Website']; ?></a><a href="http://<?php echo
    $row_lastname['Website']; ?>" target="_blank" class="style73"></a></td>
    </tr>
    <tr>
    <td colspan="4" align="center" valign="middle"
    bgcolor="#CCCCCC" class="GrayText1"><?php echo $row_lastname['Firm'];
    ?>
    <br />
    <?php echo $row_lastname['Street']; ?><br />
    <?php echo $row_lastname['City']; ?>, <?php
    echo $row_lastname['State']; ?> <?php echo $row_lastname['Zip']; ?>
    </td>
    </tr>
    </table></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    </tr>
    <?php } while ($row_lastname =
    mysql_fetch_assoc($lastname)); ?>


    o0knightro Guest

  6. #6

    Default Re: Show / Hide elements inside Repeat Region

    Change this -

    <a href="http://<?php echo
    $row_lastname['Website']; ?>" target="_blank" class="style73"><?php echo
    $row_lastname['Website']; ?></a><a href="http://<?php echo
    $row_lastname['Website']; ?>" target="_blank" class="style73"></a>

    to this -

    <?php if (isset($row_lastname['Website']) &&
    !empty($row_lastname['Website'])) { ?><a href="http://<?php echo
    $row_lastname['Website']; ?>" target="_blank" class="style73"><?php echo
    $row_lastname['Website']; ?></a><?php } else { echo "(none)"; } ?>

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    ==================


    "o0knightro" <com> wrote in message
    news:g3ge26$44r$macromedia.com... 

    Murray Guest

  7. #7

    Default Re: Show / Hide elements inside Repeat Region

    Thank you so much Murray. Your code works great! I never would have figured this out alone & I am so very appreciative of the fact that you took the time to help me.

    George
    o0knightro Guest

  8. #8

    Default Re: Show / Hide elements inside Repeat Region

    You're welcome. Good luck!

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    ==================


    "o0knightro" <com> wrote in message
    news:g3gjhl$a53$macromedia.com... 

    Murray Guest

  9. #9

    Default Re: Show / Hide elements inside Repeat Region

    Simple yet effective code...
    yupieyi Guest

Similar Threads

  1. Update record inside a repeat region
    By Mike1500 in forum Dreamweaver AppDev
    Replies: 3
    Last Post: December 2nd, 10:49 AM
  2. popup menus won't hide - PVII show/hide layers behaviour
    By Jonibean in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: December 29th, 08:24 PM
  3. Show/hide form elements based on buttons selected
    By matthew in forum Dreamweaver AppDev
    Replies: 3
    Last Post: June 23rd, 08:36 AM
  4. repeat region
    By samkry in forum Dreamweaver AppDev
    Replies: 5
    Last Post: May 26th, 06:48 PM
  5. php repeat region
    By Robert Blackwell in forum Macromedia Dreamweaver
    Replies: 2
    Last Post: July 20th, 07:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139