PHP Email - Repeat Region Equivalent in Body?

My client wants a summary of products registered in the body
of an email. My email script works great but I don't know how to
add the summary of products (what I'm calling a 'repeat region').
Thanks in advance for your advice and feedback

jasons wrote:
> My recordset looks something like:
>
> cust_id product_name order_date
> 100 PRODUCTA 12/23/08
> 100 PRODUCTB 11/23/07
> 100 PRODUCTC 09/22/07
It's not clear whether this is the same recordset as the one
that
retrieves the password details, but the principle of doing
this is
exactly the same as a repeat region. If you study the code of
a repeat
region in a Dreamweaver page you'll see that it looks
something like this:
do {
// code to be repeated
} while ($row_recordsetName =
mysql_fetch_assoc($recordsetName));
So, in the code that builds the body of the email message:
$message .="Password: $password \n\n";
$message .="Registered products:\n\n";
do {
$message .= $row_recordsetName['product_name']."\n";
} while ($row_recordsetName =
mysql_fetch_assoc($recordsetName));
// rest of mail() script goes here
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • Email php function repeat region not working

    i have a form that needs to be emailed and it as products attached to it. however i have a repeat region to list all the products but when i email it ithe email only shows the first item on the list.
    below is the form set up
    //emailer
        // Email new tenant information
            $to = '[email protected]';// . ',' . '$row_rsOrder["Email"]';
            //$to = $row_rsOrder["Email"];
            $subject = "Your Order Details";
            $message = "
    <html>
    <head>
    <title>Dear ".$row_rsOrder['FirstName'].$row_rsOrder['LastName']."  please see your Order Details Below</title>
    </head>
            <body>
            <img src=\"http://www.website.com/images/logoBLPP.jpg\" alt=\"" />
            <h2>Your B Order".$row_rsOrder['OrderID']."</h2>
            <table width='800' border='0' cellspacing='0' cellpadding='0'>
                            <tr><td><p>Thank you for shopping  below are you details of the order you have recently placed. If you have any questions please contact us</p>
      <br />
            </a></p>
                            <tr><td></td></tr></table>
    <table width='980' border='1' cellspacing='0' cellpadding='10'>
          <tr valign='top'>
            <td bgcolor='#E9E9E9' class='header1'>Customer Name</td>
            <td class='text'>".$row_rsOrder['FirstName'] . $row_rsOrder['LastName']."</td>
            <td bgcolor='#E9E9E9' class='header1'>Order ID</td>
            <td bgcolor='#E9E9E9' class='text'>".$row_rsOrder['OrderID']."</td>
            <td bgcolor='#E9E9E9' class='header1'>Order Status</td>
            <td class='text'>".$row_rsOrder['TransactResult']."</td>
          </tr>
          <tr valign='top'>
            <td bgcolor='#E9E9E9' class='header1'>Email</td>
            <td class='text'>".$row_rsOrder['Email']."</td>
            <td bgcolor='#E9E9E9' class='header1'> </td>
            <td class='text'> </td>
            <td bgcolor='#E9E9E9' ><span class='header1'>Order Date</span></td>
            <td class='text'>".makeDateTime($row_rsOrder['OrderDate'], '%#d %B %Y', true)."</td>
          </tr>
          <tr valign='top'>
            <td bgcolor='#E9E9E9' class='header1'>Shipping Address</td>
            <td class='text'><p>".$row_rsOrder['Address']."</p>
              <p>".$row_rsOrder['Town']."</p>
              <p>".$row_rsOrder['PostCode']."</p>
              <p>".$row_rsOrder['Country']."</p>
              <p> </p></td>
            <td> </td>
            <td> </td>
            <td colspan='2' align='right' valign='bottom'><span class='header'> ORDER TOTAL:".DoFormatCurrency($row_rsOrder['Total'], 2, ',', '.', '£ ', '')."<br />
              </span><span class='text'>Shipping:".DoFormatCurrency($row_rsOrder['Shipping'], 2, ',', '.', '£ ', '')."</span><span class='header'><br />
            </span></td>
          </tr>
          <tr valign='top'>
            <td bgcolor='#E9E9E9' class='header1'>Product ID</td>
            <td bgcolor='#E9E9E9' class='header1'>Product Description</td>
            <td bgcolor='#E9E9E9' colspan='2' class='header1'>Size</td>
            <td bgcolor='#E9E9E9' ><span class='header1'>Quantity</span></td>
            <td bgcolor='#E9E9E9' align='right'><span class='header1'>Price</span></td>
          </tr>
          <?php do { ?>
          <tr valign='top'>
            <td class='text'>".$row_rsOrder['ProductID']."</td>
            <td class='text'>".$row_rsOrder['Product'].','.$row_rsOrder['catname']."</td>
            <td colspan='2' class='text'>".$row_rsOrder['UnitSize']."</td>
            <td><span class='text'>".$row_rsOrder['Quantity']."</span></td>
            <td align='right' class='text'>". DoFormatCurrency($row_rsOrder['UnitPrice'], 2, ',', '.', '£ ', '')."</td>
          </tr>
          <?php } while ($row_rsOrder = mysql_fetch_assoc($rsOrder)); ?>
            <tr valign='top'>
            <td class='text'> </td>
            <td class='text'> </td>
            <td colspan='2' class='text'> </td>
            <td> </td>
            <td> </td>
          </tr>
        </table>
    </body>
    </html>
            // Always set content-type when sending HTML email
            $headers = "MIME-Version: 1.0" . "\r\n";
            $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
            $headers .= 'From: company name <[email protected]>' . "\r\n";
            $send = mail($to, $subject, $message, $headers);

    Yes, ALL product information in the database were retrieved and sent to the email. Only 3 products for testing purposes.
    I just tested it down to the do-while loop. The html table code after that is missing.
    You have to bare in mind this is a crude test. The database set up query is not as complex as yours is so that may be why its working but certainly breaking up the 'message' is the way to go. I may try and get the products from another table tomorrow if I have time to test.
    The html code and column database names are the same as you have. the recordeset is 'rsOrders' instead of 'rsOrder' that you used,
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    mysql_select_db($database_conDonations, $conDonations);
    $query_rsOrders = "SELECT * FROM orders";
    $rsOrders = mysql_query($query_rsOrders, $conDonations) or die(mysql_error());
    $row_rsOrders = mysql_fetch_assoc($rsOrders);
    $totalRows_rsOrders = mysql_num_rows($rsOrders);
    //emailer
        // Email new tenant information
    $to = '[email protected]';// . ',' . '$row_rsOrder["Email"]';
            //$to = $row_rsOrder["Email"];
    $subject = "Your Order Details";
    $message = "
    <html>
    <head>
    <title>Dear ".$row_rsOrders['FirstName']." please see your Order Details Below</title>
    </head>
            <body>
    <img src=\"http://www.website.com/images/logoBLPP.jpg\" alt=\"\" />
    <h2>Your B Order".$row_rsOrders['OrderID']."</h2>
    <table width='800' border='0' cellspacing='0' cellpadding='0'>
    <tr><td><p>Thank you for shopping  below are you details of the order you have recently placed. If you have any questions please contact us</p>
    <br />
    </a></p>
    <tr><td></td></tr></table>
    <table width='980' border='1' cellspacing='0' cellpadding='10'>
          <tr valign='top'>
            <td bgcolor='#E9E9E9' class='header1'>Customer Name</td>
            <td class='text'>".$row_rsOrders['FirstName']."</td>
            <td bgcolor='#E9E9E9' class='header1'>Order ID</td>
            <td bgcolor='#E9E9E9' class='text'>".$row_rsOrders['OrderID']."</td>
            <td bgcolor='#E9E9E9' class='header1'>Order Status</td>
            <td class='text'>".$row_rsOrders['TransactResult']."</td>
          </tr>
                             <tr valign='top'>
            <td bgcolor='#E9E9E9' class='header1'>Email</td>
            <td class='text'>".$row_rsOrders['Email']."</td>
            <td bgcolor='#E9E9E9' class='header1'> </td>
            <td class='text'> </td>
            <td bgcolor='#E9E9E9' ><span class='header1'>Order Date</span></td>
            <td class='text'>".$row_rsOrders['OrderDate']."</td>
          </tr>
                            <tr valign='top'>
            <td bgcolor='#E9E9E9' class='header1'>Shipping Address</td>
            <td class='text'><p>".$row_rsOrders['Address']."</p>
              <p>".$row_rsOrders['Town']."</p>
              <p>".$row_rsOrders['PostCode']."</p>
              <p>".$row_rsOrders['Country']."</p>
              <p> </p></td>
            <td> </td>
            <td> </td>
            <td colspan='2' align='right' valign='bottom'><span class='header'> ORDER TOTAL:".$row_rsOrders['Total']."<br />
              </span><span class='text'>Shipping:".$row_rsOrders['Shipping']."</span><span class='header'><br />
            </span></td>
                                      </tr>
          <tr valign='top'>
            <td bgcolor='#E9E9E9' class='header1'>Product ID</td>
            <td bgcolor='#E9E9E9' class='header1'>Product Description</td>
            <td bgcolor='#E9E9E9' colspan='2' class='header1'>Size</td>
            <td bgcolor='#E9E9E9' ><span class='header1'>Quantity</span></td>
            <td bgcolor='#E9E9E9' align='right'><span class='header1'>Price</span></td>
          </tr>";
                            ?>
    <?php do { ?>
    <?php $message .="  <tr valign='top'>
            <td class='text'>".$row_rsOrders['ProductID']."</td>
            <td class='text'>".$row_rsOrders['Product']."</td>
            <td colspan='2' class='text'>".$row_rsOrders['UnitSize']."</td>
            <td><span class='text'>".$row_rsOrders['Quantity']."</span></td>
            <td align='right' class='text'>".$row_rsOrders['UnitPrice']."</td>
          </tr>";
                            ?>
    <?php } while ($row_rsOrders = mysql_fetch_assoc($rsOrders)); ?>
    <?php $message .="
    </body>
    </html>";
            // Always set content-type when sending HTML email
            $headers = "MIME-Version: 1.0" . "\r\n";
            $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
            $headers .= 'From: company name <[email protected]>' . "\r\n";
            $send = mail($to, $subject, $message, $headers);
    mysql_free_result($rsOrders);
    ?>

  • Php/MySQL Repeated region which doen't include the last item?

    Hi,
    I hope somebody can help me with this. I use php/MySQL.
    I need t create a repeated region which doen't include the last item (post) added to the table.
    Does somebody know how to establish this?

    In SQL, there is no native concept of the last item inserted. It's up to you to control that. What is your definition of the last item? Is it the row with the greatest datetime stamp? An autoincrement id field? Something else?
    Using an autoincrement id field as an example, the last row inserted will have the largest value, so
    Select * from MyTable where MyID != (select max MyID from MyTable)

  • Spry widget / php recordsets / repeatable regions

    okay this deals with the spry collapsiblepanel widget in cs3.
    I'm testing the ability to create a news feed with this feature
    paired with a php recordset. My issue involves the repeated widgets
    not working like the first one. I know it probably is a result of
    the region thats being repeated / the collapsible panel. Look at
    the code and this test site that i've worked up.
    test website the
    code is below...i've commented out the start and end of the
    repeated region.

    PHP, being a serverside code, will refresh the page each time there is a request made to the server. JavaScript (and Spry), being a client side code, does not have to send requests to the server and therefore allows you to change the data without a page refresh.
    Having said that, you need to have a Spry dataset in your Accordion panel.
    By following these steps, you will be well on your way to achieving what you want.
    Retrieve your data using PHP and place it in an HTML-table or similar outside of the Accordion panel
    Create a SpryHTMLDataSet based on the HTML-table
    Use the data from the Spry dataset to create a master/detail region in your Accordion panel
    Just a few questions before I go into details.
    Have you set up a connection to a database, thus be able to retrieve the data?
    Why do you need an Accordion panel to show your data?
    Have you got an online URL so that we can follow your code? Otherwise please include your code in your post.
    Please come back here with your answers and we shall try to help you on your way
    Ben

  • Proper syntax for email function including a repeat region

    Hey Guys, a fellow ADDT developer and myself ran into a odd challenge recently and was wondering if someone knew a shorter answer.
    LET ME BE CLEAR..I’m not looking for a suggestion, we have resolved the problem..we ARE LOOKING FOR PROPER or shortest FORMAT.
    (we used a submit redirect to a php page that used the “Send Page Section”  and then redirected back..the email looks great)
    This may be a mood point since ADDT is going away but, until then, we feel this will be an useful post because quite often you may have multiple products to email from your SQL statement.
    With that said. We used the send email function on submit.
    1.       Our email content was a HTML content file. Since it was not a php file our repeat region obviously did not work.
    2.       We substituted the HTML file for PHP (just for giggles)..no joy
    3.       We tried regular content as a string..no joy
    We know how to get single rows with the  {table.column} format…but we need to list all undetermined number of products/rows.
    So how would the string or function re-write look  if you needed a repeat region.
    EX:
    emailContent (“ this” . ‘does’. “work”);  regular string
    emailContent (“ this” . $var   . “work”);  regular string
    emailContent (“ this” .   do{  $row; } while( xxx = xxx)  . “work”);  DOES NOT WORK
    emailContent (“ this” .   while( xxx = xxx)  {  $row; }   . “work”);     DOES NOT WORK
    I assume the conflict is you can’t have a function like DO or While in the string….but I also can’t use a php include file.
    There must be a shorter, cleaner syntax that won’t require an advanced set of arrays or for each???
    so  how would a nice clean example of  repeat region results  inside email content, or include file for email contnent, look?
    Thanks

    David, in theory I agree with you, but to a large degree I am completely changing the logic of my human interface. My existing code pre-processes the raw data and saves the results to disk for any future usage. 
    It can then rapidly rebuild all pages for the entire Intranet site when your personal view of the data is changed. 
    After the full creation of all pages, the fixed pages can be viewed using your browser. 
    When you want to change your view, you run the code which completely rebuilds every Intranet page.
    My new software will approach the data differently.  My raw data will be stored with no pre-processing. The pre-processing will occur as the user changes dates and the pages will be built individually on demand, one at a time.
    The second phase of my Windows Form app will be to create pop-up windows that allow the users to modify the definitions for their custom views of the market. 
    When a view is changed, the software will be able to pre-process, as needed, the current date’s data and rebuild the current page with any new changes.
    I intend to create a Refresh.cpp file.  The various segments of the Form’s code will set variable such as date change, view changed, watch list changed, etc. and then call Refresh(). 
    The refresh code will then be able to do the minimum recalculation necessary to rebuild the proper HTML stream. 
    This is another reason to break up the code into various cpp segments such as: LoadRawData, RecalculateViews, BuildPage, etc.
    PS: David, I tried to send you a personal e-mail using your home page link. 
    Hope that was OK and not against forum rules!

  • Nested repeat region - multiple email recipients

    Basically what I'm trying to do is to send a email made up of a dynamic table to some email recipients (5-20) from a database table.
    This seemed like the right way to do it, but doesn't work correctly. The first email is sent correctly to the first email recipient. The second email is sent to the second recipient, but without any of the dynamic table.
    My question is: How to make so that the dynamic info gets sent to every person. Is there a better way to have the "send email" function repeat?
    It feels like I'm really close to a working solution, but have been struggling with this for a few hours without making any progress. Any help is greatly appreciated!
             <?php do { ?>
    <?php
      $sectemailObj = new tNG_EmailPageSection();
      $sectemailObj->getCSSFrom(__FILE__);
      $sectemailObj->setTo("{grain_closing_bids.email}");
      $sectemailObj->setFrom("[email protected]");
      $sectemailObj->setSubject("Closing Grain bids");
      $sectemailObj->setFormat("HTML/Text");
      $sectemailObj->setEncoding("ISO-8859-1");
      $sectemailObj->setImportance("Normal");
      $sectemailObj->BeginContent();
    ?>
          <p>Here's today's Closing Grain Bids.</p>
          <table width="400" border="0" cellpadding="3" cellspacing="0">
              <tr>
                <td></td>
                <td><h5><strong>Nearby Price</strong></h5></td>
                <td><h5><strong>Price Change</strong></h5></td>
                <td><h5><strong>Price on</strong></h5></td>
                <td><h5><strong>New Crop</strong></h5></td>
              </tr>
                  <?php do { ?>
                    <tr>
                      <td><?php echo $row_grain['title']; ?></td>
                      <td>$<?php echo $row_grain['price']; ?></td>
                      <td><?php echo $row_grain['price_change']; ?></td>
                      <td><?php echo $row_grain['price_on']; ?></td>
                      <td>$<?php echo $row_grain['new_crop']; ?></td>
                    </tr>
                    <?php } while ($row_grain = mysql_fetch_assoc($grain)); ?>
            </table>
          <?php
      $sectemailObj->EndContent();
      $sectemailObj->Execute();
    ?>                <?php } while ($row_grain_closing_bids = mysql_fetch_assoc($grain_closing_bids)); ?>

    The emails get sent correctly. It's the repeating region in the email content that doesn't show after the first email. I think I may not have communicated what my problem is, as well as I could have.
    The first email looked like this:
    Nearby Price
    Price Change
    Price on
    New Crop
    Corn
    $4.34
    +0.16
    06/05/09
    $4.27
    Hard Wheat
    $6.25
    +0.18
    06/05/09
    $
    Milo
    $3.79
    +0.16
    06/05/09
    $
    Oats
    $2.00
    +0.00
    06/05/09
    $
    Soybeans
    $12.00
    +0.46
    06/05/09
    $9.97
    the following emails look like this:
    Nearby Price
    Price Change
    Price on
    New Crop
    $
    $
    Anyway,  I fixed the problem when I inserted this code:
    <?php
    $rows = mysql_num_rows($Recordset1);
    if($rows > 0) {
    mysql_data_seek($Recordset1, 0);
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    ?>
    This makes so the <tr> repeats again and again, not just in the first email.
    Thanks for your help! Your replies were very helpful!

  • Nested repeat Region - run time var PHP

    I have tried several attempts at creating a nested region
    with no luck of sucess
    sql & PHP
    There are 2 record sets
    rsProduct and
    rsCourse
    rsProduct
    SELECT *
    FROM svProductList
    WHERE svProductList.productOrder
    ORDER BY productOrder ASC
    rsCourse
    SELECT *
    FROM trainingCourseTBL
    WHERE trainingCourseTBL.product = colname
    ORDER BY trainingCourseTBL.courseOrder ASC
    colname
    type numeric
    default value -1
    runtim value $row_rsProduct['productOrder']
    Start repeat region 1
    rsProduct.productName
    Start repeat region 2
    rsCourse.course
    END repeat region 2
    END Start repeat region 1
    I would like to set up a run time var for the rsCourse where
    I get the value from the first repeat regions productID
    Can someone point me towards the right direction?

    On 21 May 2007 in macromedia.dreamweaver.appdev, cdembek
    wrote:
    > Can someone point me towards the right direction?
    I don't have time for a long explanation right now, but do a
    web search
    for 'Nested Repeat Region'.
    Joe Makowiec
    http://makowiec.net/
    Email:
    http://makowiec.net/contact.php

  • PhP/MySQL Horizontal/Vertical Repeat Region

    Hi Guys,
    I'm pretty sure this question would have been asked many times before. If so, first of all my apologies for re-posting this.
    Anyway, what I'm trying to do is create a repeat region that spans for 4 columns and then repeats the rest in rows. For example, if I have 100 records in my table (MySQL), then I want to display this in a table of 4 columns and and 25 rows (in reality, the number of records would be unspecified, of course, but still the records need to be displayed on a 4 column, X row table). For example:
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    At the moment, I have no issue with displaying the records either horizontally or vertically (explicitly) using the built in "repeat region" behavior. However, where I'm having the problem is with displaying the records in a table as the one I described above.
    I'm using DW CS5 with PhP/MySQL.
    Can I still do this using the built in "repeat region" server behavior, if so how?
    Otherwise, how else could I achieve this (ideally without using any extensions)?
    Thanks in advance for any help and support,
    Cheers

    I'm believe you should be able to modify the repeat region code to do what you want it to do.  With that said we will need 2 things:
    1.  To see the code from the page.
    2.  To know the order of the results is it:
    Horizontal: 1 2 3 4
                    5 6 7 8
    Or Vertical:
    1 5
    2 6
    3 7
    4 8

  • Multiple PHP Repeat Regions

    Hey kids,
    Im currently making an admin page for a school website, which has multiple forms. basically each form has a list/menu which will display class names.... but these names are drawn out from the database in a repeat region to complete the list/menu listings.... when i went to put a repeat region on the next form, i was informed i can only use one repeat region on a recordset.... does this mean i have to go about creating a new recordset for every dropdown menu i create, or is there an easier way to use multiple repeat regions from one recordset, or an alternate way?
    David

    You can have multiple repeat regions from a single recordset, but DW won't like it.  This means that you are on your own for coding, but luckily the task is not too hard.  The trick is to RESET the MySQL pointer into the recordset between repeat regions with mysql_data_seek() (see details here - http://us3.php.net/manual/en/function.mysql-data-seek.php
    If you are not a hand coder, this may be a bit beyond your grasp just now.
    The DW-friendly way to do it would be to apply multiple recordsets to the page and use one for each repeat region.

  • Send Email with repeat region data

    Greetings again,
    I'm building an application where users place orders for multiple items. And I don't know the best way to send them confirmation emails that include a table that shows the details of their orders. I know how to trigger the email send and that is working....I know how to put simple pieces of data into the email message and into its subject area....what I need is a way to retrieve the order item details and show them all not just the first one in the array....can anyone please point me in the right direction...I've scoured the manuals and tutorials and have not found any clues.
    Thanks for your help,
    Fred Shequine
    [email protected]

    Hi Fred,
    in this case I´d suggest using the "Send Page Section By E-mail" option, as the to-be-sent page (or a defined part like a certain table) can contain a Repeat Region.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • PHP help with nested repeat region

    Hopefully someone can help me out with this one.
    I basically have some SQL returning results of a search page,
    where you can search on various keywords by checking boxes, and it
    returns Employers that match those keywords :
    mysql_select_db($database_myDatabase, $myDatabase);
    if (isset($_GET['ckbox'])){
    // get profile keys
    $ckbox = array_keys($_GET['ckbox']);
    // sql string
    $sql = 'SELECT Employers.*, EmployerContacts.* FROM
    EmployerContacts
    INNER JOIN Employers ON EmployerContacts.EmployerID =
    Employers.EmployerID
    INNER JOIN EmployerProfiles ON EmployerProfiles.EmployerID =
    EmployerContacts.EmployerID
    WHERE EmployerProfiles.ProfileID IN(' . implode(',',
    $ckbox).')
    GROUP BY Employers.EmployerID
    ORDER BY Employers.EmployerID DESC';
    $rsContacts = mysql_query($sql) or die(mysql_error());
    $row_rsContacts = mysql_fetch_assoc($rsContacts);
    @$totalRows = mysql_num_rows($rsContacts);
    else
    echo 'You did not check any profiles.';
    ?>
    The results are drawing fields from the Employers table and
    EmployerContacts table, hopefully to look like :
    Employer1
    Employer1.Contact 1
    Employer1.Contact 2
    Employer1.Contact 3
    Employer2
    Employer2.Contact 1
    Employer2.Contact 2
    Employer2.Contact 3
    etc
    However, I can only seem to get it to repeat the Employers,
    and show just the first Contact for each, like this :
    Employer1
    Employer1.Contact 1
    Employer2
    Employer2.Contact 1
    etc
    So I guess I'm looking for help with looping through the
    Contacts for each Employer.
    The code currently looks like this :
    [code attached]
    Hope that makes sense.
    Many thanks.

    Iain71,
    The DW Repeat Region cannot be nested because both loops use
    the same
    variable names (e.g. $RepeatSelectionCounter_1).
    You will have to manually edit the code, and DW may not
    recognize it
    after you do, but you should be able to get it working fairly
    easily. I
    think that you just need to change the variable names in the
    inner loop
    so that they do not conflict with the similar names in the
    outer loop
    (e.g. rename $RepeatSelectionCounter_1 to
    $RepeatSelectionCounter_2).
    Does that make sense?
    HTH,
    Randy
    > I basically have some SQL returning results of a search
    page, where you can
    > search on various keywords by checking boxes, and it
    returns Employers that
    > match those keywords :

  • How to make server behaviors repeat region vertical?

    I have done many "Server Behavior, Repeat Region" showing vertical list without any other setup, now I’m doing a new one and is showing horizontal which doesn't make any sense. Does anybody know why and how to fix this “bad behavior”?

    This is very simple page no external or internal css is for internal use only to retrieve data base information. I currently have to more from different sites working fine without any third party app or any extra coding effort.  here are codes.
    Thank you guys for your prompt response.
    <?php require_once('Connections/customers.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $maxRows_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
      $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
    mysql_select_db($database_customers, $customers);
    $query_Recordset1 = "SELECT * FROM customers";
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $customers) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    if (isset($_GET['totalRows_Recordset1'])) {
      $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
      $all_Recordset1 = mysql_query($query_Recordset1);
      $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Untitled Document</title>
    </head>
    <body>
    <table width="158%" border="1">
      <tr>
      <th scope="col">ID</th>
        <th scope="col">Name</th>
        <th scope="col">Last Name</th>
        <th scope="col">Address</th>
        <th scope="col">City</th>
        <th scope="col">State</th>
        <th scope="col">Zip Code</th>
        <th scope="col">E-mail</th>
        <th scope="col">Phone</th>
        <th scope="col">Username</th>
        <th scope="col">Password</th>
        <th scope="col">Role</th>
      </tr>
      <tr>
        <?php do { ?>
          <td align="left"><?php echo $row_Recordset1['id']; ?></td>
          <td align="left"><?php echo $row_Recordset1['name']; ?></td>
          <td align="left"><?php echo $row_Recordset1['lname']; ?></td>
          <td align="left"><?php echo $row_Recordset1['address']; ?></td>
          <td align="left"><?php echo $row_Recordset1['city']; ?></td>
          <td align="left"><?php echo $row_Recordset1['state']; ?></td>
          <td align="left"><?php echo $row_Recordset1['zip']; ?></td>
          <td align="left"><?php echo $row_Recordset1['email']; ?></td>
          <td align="left"><?php echo $row_Recordset1['phone']; ?></td>
          <td align="left"><?php echo $row_Recordset1['username']; ?></td>
          <td align="left"><?php echo $row_Recordset1['password']; ?></td>
          <td align="left"><?php echo $row_Recordset1['role']; ?></td>
          <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
      </tr>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

  • Tabbed panels repeat region in cms displays 2nd item as a block of content

    Hi everyone, hope someone can help:
    I have a test page live
    http://aegmotorhomes.co.uk/usedtest1.php
    Problem is this-
    I have added a repeat region on my dreamweaver template
    I use Perch CMS as my management for staff to add new items for sale on this page
    I have built a tabbed panels to list the item
    On my CMS it allows me to press "add another" which then adds the tabbed panels again as a new item and the staff input the details
    My problem is the first item works perfect and all tabbs work fine, each item after that doesn't have tabbs and shows all content as one whole block
    I think it is to do with the ID and applies the java file only to item one, thats my guess.
    I have attached code below for my tabbed panels template, .js file and .css file - can anyone shed any light on this issue"
    TEMPLATE
    <style type="text/css">
    #container1 {
              width: 700px;
              background-color: #E6E6E6;
              border: .1em solid #999;
              padding-top: 5px;
              padding-right: 5px;
              padding-left: 5px;
              height: auto;
              margin-bottom: 30px;
    #item_description {
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1.3em;
              color: #333;
              background-color: #FFF;
              height: 30px;
              border-bottom-width: .1em;
              border-bottom-style: dotted;
              border-bottom-color: #333;
              font-weight: bold;
              margin-bottom: 10px;
    #price {
              margin-top: 5px;
              float: right;
              width: 150px;
              background-color: #EAEAEA;
              border: 0.1em solid #CCC;
    .BOLDTEXT {
              font-weight: bold;
              text-align: center;
              color: #FFF;
    .BOLDTEXT_PRICE {
              color: #333;
    #engine_spec {
              float: left;
              width: 190px;
              font-family: Arial, Helvetica, sans-serif;
              font-size: .75em;
              border-top-style: none;
              border-right-style: none;
              border-bottom-style: none;
              border-left-style: none;
    #top_price {
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1.2em;
              color: #099;
              float: right;
              width: 150px;
              font-weight: bold;
              text-align: right;
    #top_price {
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1.4em;
              color: #099;
    #overview_picture {
              height: 150px;
              width: 200px;
              background-color: #CCC;
              float: left;
              margin-right: 10px;
              margin-top: 5px;
    .BOLDTEXT_blackprice {
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1.4em;
              color: #099;
    #smallprint {
              font-family: Arial, Helvetica, sans-serif;
              font-size: .5em;
              color: #666;
              margin-top: 2px;
    table tr td {
              font-size: 0.75em;
              font-family: Arial, Helvetica, sans-serif;
    .specwhite {
              color: #FFF;
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1em;
              font-weight: bold;
    #reserve {
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1.2em;
              font-weight: bold;
              color: #FFF;
              background-color: #099;
              width: 140px;
              float: right;
              margin-top: 10px;
              padding: 5px;
              text-align: center;
              border: .1em solid #999;
    </style>
    <script src="../../../../SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    <link href="../../../../SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
    <div id="container1">
      <div id="TabbedPanels1" class="TabbedPanels">
        <ul class="TabbedPanelsTabGroup">
          <li class="TabbedPanelsTab" tabindex="0">Overview</li>
          <li class="TabbedPanelsTab" tabindex="0">Description</li>
          <li class="TabbedPanelsTab" tabindex="0">Images</li>
          <li class="TabbedPanelsTab" tabindex="0">Specification</li>
        </ul>
        <div class="TabbedPanelsContentGroup">
          <div class="TabbedPanelsContent">
            <div id="item_description"><perch:content id="Title1" label="Title" type="text" />
              <div id="top_price">£<perch:content id="Title2" label="Top Price" type="text" /></div>
            </div>
            <div id="overview_picture"><img src="<perch:content id="photo" label="Photo" type="image" />" class="photo" /></div>
            <div class="engine_spec" id="engine_spec">
              <table width="100%" border="0" cellpadding="5" cellspacing="7">
                <tr>
                  <td width="35%" bgcolor="#EAEAEA">Year of Make</td>
                  <td width="65%" bgcolor="#999999"><strong class="spec_white"><span class="engine_spec"><span class="specwhite"><perch:content id="Title3" label="Year" type="text" /></span></span></strong></td>
                </tr>
                <tr>
                  <td bgcolor="#EAEAEA">Current Miles</td>
                  <td bgcolor="#999999" class="spec_white"><span class="specwhite"><perch:content id="Title4" label="Mileage" type="text" /></span></td>
                </tr>
                <tr>
                  <td bgcolor="#EAEAEA">Engine Size</td>
                  <td bgcolor="#999999" class="spec_white"><span class="specwhite"><perch:content id="Title5" label="Engine" type="text" /></span></td>
                </tr>
                <tr>
                  <td bgcolor="#EAEAEA">Body Colour</td>
                  <td bgcolor="#999999" class="spec_white"><span class="specwhite"><perch:content id="Title6" label="Colour" type="text" /></span></td>
                </tr>
                <tr>
                  <td bgcolor="#EAEAEA">Transmission</td>
                  <td bgcolor="#999999" class="spec_white"><span class="specwhite"><perch:content id="Title7" label="Transmission" type="text" /></span></td>
                </tr>
              </table>
            </div>
            <div id="price">
              <table width="150" border="0" cellspacing="9">
                <tr>
                  <td width="50" height="25" bgcolor="#999999" class="BOLDTEXT">WAS</td>
                  <td width="81" class="BOLDTEXT"><span class="BOLDTEXT_blackprice">£<perch:content id="Title8" label="Old Price" type="text" /></span></td>
                </tr>
                <tr>
                  <td height="25" bgcolor="#999999" class="BOLDTEXT">NOW</td>
                  <td class="BOLDTEXT"><span class="BOLDTEXT_blackprice">£<perch:content id="Title9" label="New Price" type="text" /></span></td>
                </tr>
                <tr>
                  <td height="25" bgcolor="#999999" class="BOLDTEXT">SAVE</td>
                  <td class="BOLDTEXT"><span class="BOLDTEXT_blackprice">£<perch:content id="Title9a" label="Save" type="text" /></span></td>
                </tr>
              </table>
            </div>
            <div id="reserve">Reserve Motorhome</div>
          </div>
          <div class="TabbedPanelsContent"><perch:content id="Text" label="Description" type="textarea" editor="ckeditor" html="true" /></div>
          <div class="TabbedPanelsContent"><table width="650" cellspacing="5">
      <tr>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
      </tr>
      <tr>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
      </tr>
      <tr>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
      </tr>
      <tr>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
      </tr>
      <tr>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
      </tr>
    </table></div>
          <div class="TabbedPanelsContent"><perch:content id="Text1" label="Specification" type="textarea" editor="ckeditor" html="true" /></div>
        </div>
      </div>
    </div>
    <script type="text/javascript">
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    </script>
    .JS file
    (function() { // BeginSpryComponent
    if (typeof Spry == "undefined") window.Spry = {}; if (!Spry.Widget) Spry.Widget = {};
    Spry.Widget.TabbedPanels = function(element, opts)
              this.element = this.getElement(element);
              this.defaultTab = 0; // Show the first panel by default.
              this.tabSelectedClass = "TabbedPanelsTabSelected";
              this.tabHoverClass = "TabbedPanelsTabHover";
              this.tabFocusedClass = "TabbedPanelsTabFocused";
              this.panelVisibleClass = "TabbedPanelsContentVisible";
              this.focusElement = null;
              this.hasFocus = false;
              this.currentTabIndex = 0;
              this.enableKeyboardNavigation = true;
              this.nextPanelKeyCode = Spry.Widget.TabbedPanels.KEY_RIGHT;
              this.previousPanelKeyCode = Spry.Widget.TabbedPanels.KEY_LEFT;
              Spry.Widget.TabbedPanels.setOptions(this, opts);
              // If the defaultTab is expressed as a number/index, convert
              // it to an element.
              if (typeof (this.defaultTab) == "number")
                        if (this.defaultTab < 0)
                                  this.defaultTab = 0;
                        else
                                  var count = this.getTabbedPanelCount();
                                  if (this.defaultTab >= count)
                                            this.defaultTab = (count > 1) ? (count - 1) : 0;
                        this.defaultTab = this.getTabs()[this.defaultTab];
              // The defaultTab property is supposed to be the tab element for the tab content
              // to show by default. The caller is allowed to pass in the element itself or the
              // element's id, so we need to convert the current value to an element if necessary.
              if (this.defaultTab)
                        this.defaultTab = this.getElement(this.defaultTab);
              this.attachBehaviors();
    Spry.Widget.TabbedPanels.prototype.getElement = function(ele)
              if (ele && typeof ele == "string")
                        return document.getElementById(ele);
              return ele;
    Spry.Widget.TabbedPanels.prototype.getElementChildren = function(element)
              var children = [];
              var child = element.firstChild;
              while (child)
                        if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
                                  children.push(child);
                        child = child.nextSibling;
              return children;
    Spry.Widget.TabbedPanels.prototype.addClassName = function(ele, className)
              if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
                        return;
              ele.className += (ele.className ? " " : "") + className;
    Spry.Widget.TabbedPanels.prototype.removeClassName = function(ele, className)
              if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
                        return;
              ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
    Spry.Widget.TabbedPanels.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
              if (!optionsObj)
                        return;
              for (var optionName in optionsObj)
                        if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
                                  continue;
                        obj[optionName] = optionsObj[optionName];
    Spry.Widget.TabbedPanels.prototype.getTabGroup = function()
              if (this.element)
                        var children = this.getElementChildren(this.element);
                        if (children.length)
                                  return children[0];
              return null;
    Spry.Widget.TabbedPanels.prototype.getTabs = function()
              var tabs = [];
              var tg = this.getTabGroup();
              if (tg)
                        tabs = this.getElementChildren(tg);
              return tabs;
    Spry.Widget.TabbedPanels.prototype.getContentPanelGroup = function()
              if (this.element)
                        var children = this.getElementChildren(this.element);
                        if (children.length > 1)
                                  return children[1];
              return null;
    Spry.Widget.TabbedPanels.prototype.getContentPanels = function()
              var panels = [];
              var pg = this.getContentPanelGroup();
              if (pg)
                        panels = this.getElementChildren(pg);
              return panels;
    Spry.Widget.TabbedPanels.prototype.getIndex = function(ele, arr)
              ele = this.getElement(ele);
              if (ele && arr && arr.length)
                        for (var i = 0; i < arr.length; i++)
                                  if (ele == arr[i])
                                            return i;
              return -1;
    Spry.Widget.TabbedPanels.prototype.getTabIndex = function(ele)
              var i = this.getIndex(ele, this.getTabs());
              if (i < 0)
                        i = this.getIndex(ele, this.getContentPanels());
              return i;
    Spry.Widget.TabbedPanels.prototype.getCurrentTabIndex = function()
              return this.currentTabIndex;
    Spry.Widget.TabbedPanels.prototype.getTabbedPanelCount = function(ele)
              return Math.min(this.getTabs().length, this.getContentPanels().length);
    Spry.Widget.TabbedPanels.addEventListener = function(element, eventType, handler, capture)
              try
                        if (element.addEventListener)
                                  element.addEventListener(eventType, handler, capture);
                        else if (element.attachEvent)
                                  element.attachEvent("on" + eventType, handler);
              catch (e) {}
    Spry.Widget.TabbedPanels.prototype.cancelEvent = function(e)
              if (e.preventDefault) e.preventDefault();
              else e.returnValue = false;
              if (e.stopPropagation) e.stopPropagation();
              else e.cancelBubble = true;
              return false;
    Spry.Widget.TabbedPanels.prototype.onTabClick = function(e, tab)
              this.showPanel(tab);
              return this.cancelEvent(e);
    Spry.Widget.TabbedPanels.prototype.onTabMouseOver = function(e, tab)
              this.addClassName(tab, this.tabHoverClass);
              return false;
    Spry.Widget.TabbedPanels.prototype.onTabMouseOut = function(e, tab)
              this.removeClassName(tab, this.tabHoverClass);
              return false;
    Spry.Widget.TabbedPanels.prototype.onTabFocus = function(e, tab)
              this.hasFocus = true;
              this.addClassName(tab, this.tabFocusedClass);
              return false;
    Spry.Widget.TabbedPanels.prototype.onTabBlur = function(e, tab)
              this.hasFocus = false;
              this.removeClassName(tab, this.tabFocusedClass);
              return false;
    Spry.Widget.TabbedPanels.KEY_UP = 38;
    Spry.Widget.TabbedPanels.KEY_DOWN = 40;
    Spry.Widget.TabbedPanels.KEY_LEFT = 37;
    Spry.Widget.TabbedPanels.KEY_RIGHT = 39;
    Spry.Widget.TabbedPanels.prototype.onTabKeyDown = function(e, tab)
              var key = e.keyCode;
              if (!this.hasFocus || (key != this.previousPanelKeyCode && key != this.nextPanelKeyCode))
                        return true;
              var tabs = this.getTabs();
              for (var i =0; i < tabs.length; i++)
                        if (tabs[i] == tab)
                                  var el = false;
                                  if (key == this.previousPanelKeyCode && i > 0)
                                            el = tabs[i-1];
                                  else if (key == this.nextPanelKeyCode && i < tabs.length-1)
                                            el = tabs[i+1];
                                  if (el)
                                            this.showPanel(el);
                                            el.focus();
                                            break;
              return this.cancelEvent(e);
    Spry.Widget.TabbedPanels.prototype.preorderTraversal = function(root, func)
              var stopTraversal = false;
              if (root)
                        stopTraversal = func(root);
                        if (root.hasChildNodes())
                                  var child = root.firstChild;
                                  while (!stopTraversal && child)
                                            stopTraversal = this.preorderTraversal(child, func);
                                            try { child = child.nextSibling; } catch (e) { child = null; }
              return stopTraversal;
    Spry.Widget.TabbedPanels.prototype.addPanelEventListeners = function(tab, panel)
              var self = this;
              Spry.Widget.TabbedPanels.addEventListener(tab, "click", function(e) { return self.onTabClick(e, tab); }, false);
              Spry.Widget.TabbedPanels.addEventListener(tab, "mouseover", function(e) { return self.onTabMouseOver(e, tab); }, false);
              Spry.Widget.TabbedPanels.addEventListener(tab, "mouseout", function(e) { return self.onTabMouseOut(e, tab); }, false);
              if (this.enableKeyboardNavigation)
                        // XXX: IE doesn't allow the setting of tabindex dynamically. This means we can't
                        // rely on adding the tabindex attribute if it is missing to enable keyboard navigation
                        // by default.
                        // Find the first element within the tab container that has a tabindex or the first
                        // anchor tag.
                        var tabIndexEle = null;
                        var tabAnchorEle = null;
                        this.preorderTraversal(tab, function(node) {
                                  if (node.nodeType == 1 /* NODE.ELEMENT_NODE */)
                                            var tabIndexAttr = tab.attributes.getNamedItem("tabindex");
                                            if (tabIndexAttr)
                                                      tabIndexEle = node;
                                                      return true;
                                            if (!tabAnchorEle && node.nodeName.toLowerCase() == "a")
                                                      tabAnchorEle = node;
                                  return false;
                        if (tabIndexEle)
                                  this.focusElement = tabIndexEle;
                        else if (tabAnchorEle)
                                  this.focusElement = tabAnchorEle;
                        if (this.focusElement)
                                  Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "focus", function(e) { return self.onTabFocus(e, tab); }, false);
                                  Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "blur", function(e) { return self.onTabBlur(e, tab); }, false);
                                  Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "keydown", function(e) { return self.onTabKeyDown(e, tab); }, false);
    Spry.Widget.TabbedPanels.prototype.showPanel = function(elementOrIndex)
              var tpIndex = -1;
              if (typeof elementOrIndex == "number")
                        tpIndex = elementOrIndex;
              else // Must be the element for the tab or content panel.
                        tpIndex = this.getTabIndex(elementOrIndex);
              if (!tpIndex < 0 || tpIndex >= this.getTabbedPanelCount())
                        return;
              var tabs = this.getTabs();
              var panels = this.getContentPanels();
              var numTabbedPanels = Math.max(tabs.length, panels.length);
              for (var i = 0; i < numTabbedPanels; i++)
                        if (i != tpIndex)
                                  if (tabs[i])
                                            this.removeClassName(tabs[i], this.tabSelectedClass);
                                  if (panels[i])
                                            this.removeClassName(panels[i], this.panelVisibleClass);
                                            panels[i].style.display = "none";
              this.addClassName(tabs[tpIndex], this.tabSelectedClass);
              this.addClassName(panels[tpIndex], this.panelVisibleClass);
              panels[tpIndex].style.display = "block";
              this.currentTabIndex = tpIndex;
    Spry.Widget.TabbedPanels.prototype.attachBehaviors = function(element)
              var tabs = this.getTabs();
              var panels = this.getContentPanels();
              var panelCount = this.getTabbedPanelCount();
              for (var i = 0; i < panelCount; i++)
                        this.addPanelEventListeners(tabs[i], panels[i]);
              this.showPanel(this.defaultTab);
    })(); // EndSpryComponent
    >CSS file
    @charset "UTF-8";
    /* SpryTabbedPanels.css - version 0.6 - Spry Pre-Release 1.6.1 */
    /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
    /* Horizontal Tabbed Panels
    * The default style for a TabbedPanels widget places all tab buttons
    * (left aligned) above the content panel.
    /* This is the selector for the main TabbedPanels container. For our
    * default style, this container does not contribute anything visually,
    * but it is floated left to make sure that any floating or clearing done
    * with any of its child elements are contained completely within the
    * TabbedPanels container, to minimize any impact or undesireable
    * interaction with other floated elements on the page that may be used
    * for layout.
    * If you want to constrain the width of the TabbedPanels widget, set a
    * width on the TabbedPanels container. By default, the TabbedPanels widget
    * expands horizontally to fill up available space.
    * The name of the class ("TabbedPanels") used in this selector is not
    * necessary to make the widget function. You can use any class name you
    * want to style the TabbedPanels container.
    .TabbedPanels {
              overflow: hidden;
              margin: 0px;
              padding: 0px;
              clear: none;
              width: 100%; /* IE Hack to force proper layout when preceded by a paragraph. (hasLayout Bug)*/
    /* This is the selector for the TabGroup. The TabGroup container houses
    * all of the tab buttons for each tabbed panel in the widget. This container
    * does not contribute anything visually to the look of the widget for our
    * default style.
    * The name of the class ("TabbedPanelsTabGroup") used in this selector is not
    * necessary to make the widget function. You can use any class name you
    * want to style the TabGroup container.
    .TabbedPanelsTabGroup {
              margin: 0px;
              padding: 0px;
    /* This is the selector for the TabbedPanelsTab. This container houses
    * the title for the panel. This is also the tab "button" that the user clicks
    * on to activate the corresponding content panel so that it appears on top
    * of the other tabbed panels contained in the widget.
    * For our default style, each tab is positioned relatively 1 pixel down from
    * where it wold normally render. This allows each tab to overlap the content
    * panel that renders below it. Each tab is rendered with a 1 pixel bottom
    * border that has a color that matches the top border of the current content
    * panel. This gives the appearance that the tab is being drawn behind the
    * content panel.
    * The name of the class ("TabbedPanelsTab") used in this selector is not
    * necessary to make the widget function. You can use any class name you want
    * to style this tab container.
    .TabbedPanelsTab {
              position: relative;
              top: 1px;
              float: left;
              background-color: #DDD;
              list-style: none;
              -moz-user-select: none;
              -khtml-user-select: none;
              cursor: pointer;
              font-family: sans-serif;
              font-size: small;
              font-weight: bold;
              margin-top: 0px;
              margin-right: 1px;
              margin-bottom: 0px;
              margin-left: 0px;
              padding-top: 4px;
              padding-right: 10px;
              padding-left: 10px;
              padding-bottom: 4px;
    /* This selector is an example of how to change the appearnce of a tab button
    * container as the mouse enters it. The class "TabbedPanelsTabHover" is
    * programatically added and removed from the tab element as the mouse enters
    * and exits the container.
    .TabbedPanelsTabHover {
              background-color: #CCC;
    /* This selector is an example of how to change the appearance of a tab button
    * container after the user has clicked on it to activate a content panel.
    * The class "TabbedPanelsTabSelected" is programatically added and removed
    * from the tab element as the user clicks on the tab button containers in
    * the widget.
    * As mentioned above, for our default style, tab buttons are positioned
    * 1 pixel down from where it would normally render. When the tab button is
    * selected, we change its bottom border to match the background color of the
    * content panel so that it looks like the tab is part of the content panel.
    .TabbedPanelsTabSelected {
              background-color: #FFF;
              color: #333;
              border-top-color: fff;
              border-right-color: fff;
              border-bottom-color: fff;
              border-left-color: fff;
              border-color: fff;
              outline-color: fff;
    /* This selector is an example of how to make a link inside of a tab button
    * look like normal text. Users may want to use links inside of a tab button
    * so that when it gets focus, the text *inside* the tab button gets a focus
    * ring around it, instead of the focus ring around the entire tab.
    .TabbedPanelsTab a {
              color: black;
              text-decoration: none;
    /* This is the selector for the ContentGroup. The ContentGroup container houses
    * all of the content panels for each tabbed panel in the widget. For our
    * default style, this container provides the background color and borders that
    * surround the content.
    * The name of the class ("TabbedPanelsContentGroup") used in this selector is
    * not necessary to make the widget function. You can use any class name you
    * want to style the ContentGroup container.
    .TabbedPanelsContentGroup {
              clear: both;
              background-color: #F9F9F1;
              height: auto;
              margin-bottom: 3px;
              border: .1px solid #999;
    /* This is the selector for the Content panel. The Content panel holds the
    * content for a single tabbed panel. For our default style, this container
    * provides some padding, so that the content is not pushed up against the
    * widget borders.
    * The name of the class ("TabbedPanelsContent") used in this selector is
    * not necessary to make the widget function. You can use any class name you
    * want to style the Content container.
    .TabbedPanelsContent {
              overflow: hidden;
              padding: 4px;
    /* This selector is an example of how to change the appearnce of the currently
    * active container panel. The class "TabbedPanelsContentVisible" is
    * programatically added and removed from the content element as the panel
    * is activated/deactivated.
    .TabbedPanelsContentVisible {
              background-color: #FFF;
              font-family: Arial, Helvetica, sans-serif;
              font-size: 0.75em;
              color: #333;
              padding: 20px;
              clear: both;
              margin-bottom: 5px;
              height: auto;
    /* Vertical Tabbed Panels
    * The following rules override some of the default rules above so that the
    * TabbedPanels widget renders with its tab buttons along the left side of
    * the currently active content panel.
    * With the rules defined below, the only change that will have to be made
    * to switch a horizontal tabbed panels widget to a vertical tabbed panels
    * widget, is to use the "VTabbedPanels" class on the top-level widget
    * container element, instead of "TabbedPanels".
    .VTabbedPanels {
              overflow: hidden;
              zoom: 1;
    /* This selector floats the TabGroup so that the tab buttons it contains
    * render to the left of the active content panel. A border is drawn around
    * the group container to make it look like a list container.
    .VTabbedPanels .TabbedPanelsTabGroup {
              float: left;
              width: 10em;
              height: 20em;
              background-color: #EEE;
              position: relative;
              border-top: solid 1px #999;
              border-right: solid 1px #999;
              border-left: solid 1px #CCC;
              border-bottom: solid 1px #CCC;
    /* This selector disables the float property that is placed on each tab button
    * by the default TabbedPanelsTab selector rule above. It also draws a bottom
    * border for the tab. The tab button will get its left and right border from
    * the TabGroup, and its top border from the TabGroup or tab button above it.
    .VTabbedPanels .TabbedPanelsTab {
              float: none;
              margin: 0px;
              border-top: none;
              border-left: none;
              border-right: none;
    /* This selector disables the float property that is placed on each tab button
    * by the default TabbedPanelsTab selector rule above. It also draws a bottom
    * border for the tab. The tab button will get its left and right border from
    * the TabGroup, and its top border from the TabGroup or tab button above it.
    .VTabbedPanels .TabbedPanelsTabSelected {
              background-color: #EEE;
              border-bottom: solid 1px #999;
    /* This selector floats the content panels for the widget so that they
    * render to the right of the tabbed buttons.
    .VTabbedPanels .TabbedPanelsContentGroup {
              clear: none;
              float: left;
              padding: 0px;
              width: 30em;
              height: 20em;
    /* Styles for Printing */
    @media print {
    .TabbedPanels {
              overflow: visible !important;
    .TabbedPanelsContentGroup {
              display: block !important;
              overflow: visible !important;
              height: auto !important;
    .TabbedPanelsContent {
              overflow: visible !important;
              display: block !important;
              clear:both !important;
    .TabbedPanelsTab {
              overflow: visible !important;
              display: block !important;
              clear:none !important;
              height: 100%;
    #TabbedPanels1 {
              height: auto;
              padding-top: 5px;
              background-color: #EAEAEA;
              width: 700px;
    I did read this but don't know where to start: http://www.webdevforums.com/showthread.php?27428-Dreamweaver-spry-collapsible-panel-amp-re peating-regions
    Can anybody HELP PLEASE PLEASE

    I think I counted three tabbed panels in the markup, each with an ID of TabbedPanels1
    You have only one constructor that makes one instance of the tabeed panels with an ID of TabbedPanels1
    There are a couple of things that create the problem.
    There can only be one ID with the same name in a document, thus the ID's of the TabbedPanels will need to change from TabbedPanels1 for the second and third instances to TabbedPanels2 and TabbedPanels3 (or similar) respectively.
    There needs to be a constructor for each tabbed panels like
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");
    var TabbedPanels3 = new Spry.Widget.TabbedPanels("TabbedPanels3");
    Gramps

  • Nest repeating regions?

    I am new to working with DW templates but am trying to set up
    a site for a client who will edit in Contribute. I'd like to set
    these up using templates so the client won't inadvertently mess up
    the formatting.
    However, I'm running into a problem setting up a template for
    an Events listing. I need to have a repeatable region for each
    month of events she will add and then inside each month, a
    repeating region for each event within that month. So far, I have
    not been able to make this work.
    Is something like this possible? This doesn't seem that
    advanced or sophisticated so perhaps I am just missing something?
    Thanks for any advice.

    "choirellie" <[email protected]> wrote in
    message
    news:g0fg42$o0$[email protected]..
    > Maybe I wasn't explaining clearly what I mean...
    >
    > I haven't got the template set up yet because I can not
    figure out how to
    > have
    > a repeating region within another repeating region.
    >
    > The reason I want to specifically have it in a repeating
    region is to make
    > it
    > easier and less likely for bad formatting tags to creep
    in when the client
    > wants to add a new month and/or event within a month.
    >
    > The client ("they") is not doing anything yet - I have
    merely been testing
    > a
    > setup that I would like to use for a client. using
    pseudo code, this is
    > something like what I want to do:
    >
    > <repeatable region1>
    > non-editable formatting<editable
    region>Month<end editable region>
    > <repeatable region2>
    > non editable formatting<editable region>Event
    Details<end editable region>
    > <end repeatable region2><end repeatable
    region1>
    >
    > Does this make sense? Am I going about this the wrong
    way? I would be
    > very
    > comfortable doing all this with server side code and
    database (either
    > ColdFusion or PHP) but the template business is really
    throwing me.
    but that repeating region info would have to come from a
    database, which
    would need its own form page for updates/additions/deletions,
    etc... and you
    said you weren't going to use a database yet... so doesn't
    that boil down to
    "why do a repeating region" since they're going to manually
    enter it anyway?

  • Problem updating rows of recordset with repeat region

    Hi,
    So here's what I'm trying to do - I have a repeat region displaying a series of rows from a recordset. Each row has an "id" value and a "Votes" value. The id value is just an identifier, and the Votes value is the total number of votes. The rows are then organized by the Votes column in descending order (so that the row with the "most Votes" is displayed at the top). The whole thing is set up in kind of a table, so each row has a "Vote" button. When a user clicks the button it is supposed to increase that row's Votes by 1 - in effect creatign a Digg-style system.
    I'm having two problems-
    1. How can I get id value for the current row when using repeat region? I would assume that I first have to figure out the row, but how would I got about this?
    2. This is probably a much simpler problem, but how do I add to a mysql integer instead of just replacing the number? Is there any add function? Or can I do it the "BASIC way" (x = x + y)?
    Now for my code. What is here right now is a pretty simple "frame" of a website using PHP for the server-side scripting and MySQL for the database. Also, most of the PHP is generated by Dreamweaver, since I'm pretty novice when it comes to PHP.
    Here is my "repeat region" section alone-
    <?php do { ?>
        <table width="780" border="0">
          <tr>
            <td width="195"><?php echo $row_all['Title']; ?></td>
            <td width="195"><?php echo $row_all['Genre']; ?></td>
            <td width="130"><?php echo $row_all['Year']; ?></td>
            <td width="130"><?php echo $row_all['Votes']; ?></td>
            <td width="65"><a href=<?php
              $id1 = $row_all['id'];
    $con = mysql_connect("localhost","root","");
    if (!$con)
      die('Could not connect: ' . mysql_error());
    mysql_select_db("dig", $con);
    mysql_query("UPDATE list SET Votes =300 WHERE id = '$id1'");
    mysql_close($con);
    ?> >+1</a></td>
            <td width="65">-1</td>
          </tr>
        </table>
        <?php } while ($row_all = mysql_fetch_assoc($all)); ?>
    And, for the sake of completition, here is the entire file-
    BANNER
    MENU
    CONTENT
      LIST                                                                     
    +1
    -1
    Just let me know if you need any more info, and thanks in advance!
    -B

    Hi David,
    I read your reply and thankyou, but I am not sure I fully
    understand. Could
    you be a little more specific please.
    "David Powers" <[email protected]> wrote in message
    news:e9vsg2$ljd$[email protected]..
    > JED wrote:
    >> Why is this and what can I do?
    >
    > Answered your duplicate post in the main Dreamweaver
    forum.
    >
    > --
    > David Powers
    > Author, "Foundation PHP for Dreamweaver 8" (friends of
    ED)
    > Author, "Foundation PHP 5 for Flash" (friends of ED)
    >
    http://foundationphp.com/

Maybe you are looking for

  • Getting values from JLabel[] with JButton[] help!

    Hello everyone! My problem is: I have created JPanel, i have an array of JButtons and array of JLabels, they are all placed on JPanel depending from record count in *.mdb table - JLabels have its own value selected from Access table.mdb! I need- each

  • Crertifiacte download in Safari Browser saves file with CGI name

    We need to download user certificate in FireFox and Safari browsers as a multiple MIME message. ---- Sample MIME message template - START ---- Content-Type: multipart/mixed; boundary="ABABABABABAB" --ABABABABABAB Content-type: application/x-x509-user

  • Spinning Beach Ball on Safari

    Hello - I am running OS X version 10.10.2 on a MacBook Pro 13-inch mid 2012 with a 2.5 GHz Intel Core i5 processor, 16GB 1600MHz DDR3 and Safari 8.0.4.  When running Safari, I often get the "spinning beach ball" and the associated page doesn't seem t

  • SAP MDM Console

    Hi, I'm new to MDM Console. Can anyone please tell me how can I, from SAP MDM Console restrict a particular user from <u>viewing</u> specific records in MDM Data Manager. Thanking you in advance. Hemal

  • EBS - Electronic Bank Statement (MT940) - Not to be posted error

    Hi I have done the EBS configuration for MT940 and uploaded the file through FF.5 and the fiel is uploaded and the same is coming in FF.6.  Though I defined posting rule properly it is not clearing and no entry is getting posted.  When I go to FEBA i