When placing each search result in its own collapse panel, only first panel works (PHP foreach loop)

Hi there,
<?php foreach ($results as $result): ?>
  <div id="CollapsiblePanel1" class="CollapsiblePanel">
    <div class="CollapsiblePanelTab">
<?php echo htmlspecialchars($result['name'], ENT_QUOTES, 'UTF-8'); ?>   
    </div>
    <div class="CollapsiblePanelContent">
  <?php echo htmlspecialchars($result['description'], ENT_QUOTES, 'UTF-8'); ?>
    </div>
  </div>
  <?php endforeach; ?>
<script type="text/javascript">
var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1");
  </script>
Above is the segment where I want to generate a list of results using PHP/SQL. I know for sure that there isn't anything wrong with the PHP, there's something about the collapsible panels that I can't get my head around...
WHAT I WANT IT TO DO:
Display the result of my query, each in a collapsible panel with the Name in the panel's tab and the additional Description on the panel's content area. Do this for all results.
WHAT IT DOES:
The above, except that only the first collapsible panel works (collapses fine). The results following are still in collapsible panels with the exception that they don't collapse at all.
So can anyone come up with a good solution to fix this? Something quick will do (that I don't have to make drastic changes to my code), I suspect that it has something to do with this line:
var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1");
That it recognizes the first panel as CollapsiblePanel1, the other panels are just unknown... I don't know, that's all I can come up with. Thanks for your time.

Thanks for the tip Gramps, got to the solution!
<?php foreach ($results as $result): ?>
  <div id="CollapsiblePanel<?php echo htmlspecialchars($result['id'], ENT_QUOTES, 'UTF-8'); ?>"  " class="CollapsiblePanel">
    <div class="CollapsiblePanelTab">
<?php echo htmlspecialchars($result['name'], ENT_QUOTES, 'UTF-8'); ?>  
    </div>
    <div class="CollapsiblePanelContent">
  <?php echo htmlspecialchars($result['description'], ENT_QUOTES, 'UTF-8'); ?>
    </div>
  </div>
<script type="text/javascript">
var CollapsiblePanel<?php echo htmlspecialchars($result['id'], ENT_QUOTES, 'UTF-8'); ?> = new Spry.Widget.CollapsiblePanel("CollapsiblePanel<?php echo htmlspecialchars($result['id'], ENT_QUOTES, 'UTF-8'); ?>");
  </script>
  <?php endforeach; ?>
By allowing the script to loop and matching the id. Nice suggestion for the accordion but unfortunately the code above was just an example... the actual results will include tables, <hr> and whatnot.
Being new to the Dreamweaver scene (actually to be honest, I've only started learning about web development a week ago) why are the Spry js (or just Spry in particular) files so large? Are there plugins/methods I can get to delete some features I don't need? I have absolutely no experience with JS... yet.

Similar Messages

  • Outlook 2013 crashes when opening Calendar search result

    I have a user who uses her Outlook 2013 calendar extensively, mainly to note for herself when she has spoken to a customer, and creating appointments for when she needs to speak to them again. (This is outside of our policy to note the contact in
    MS CRM.) She can have scores of such Calendar items each day.
    When seraching for these appointments in her Calendar, she gets the list of results, but Oulook crashes when she tries to open any of them. Sometimes Outlook restarts on its own, sometimes she must relaunch it herself.
    Related threads reference a wwlib.dll error, but she is not getting that. It is Outlook.exe itself that is crashing. There are other threads that reference other open windows, or items containing webpages or tables, but these do not apply to her, either.
    Event Data (two related entries) contain the following:
    OUTLOOK.EXE
    15.0.4551.1004
    5253ad6f
    c0000005
    00025b09
    19cc
    01cef2a610938033
    C:\Program Files\Microsoft Office\Office15\OUTLOOK.EXE
    C:\Program Files\Microsoft Office\Office15\OUTLOOK.EXE
    77f5e493-5e9b-11e3-9ef4-00219b4a7172
    And:
    3915849571
    1
    APPCRASH
    Not available
    0
    OUTLOOK.EXE
    15.0.4511.1004
    5253ad6f
    OUTLOOK.EXE
    15.0.4551.1004
    5253ad6f
    c0000005
    00025b09
    C:\Users\[username]\AppData\Local\Temp\163947659.cvr C:\User\[username]\AppData\Local\Temp\CVR780F.tmp.cvr
    C:\Users\[username]\AppData\Local\Temp\WERA546.tmp.WERInternalMetadata.xml
    C:\Users\[username]\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_OUTLOOK.EXE_2e80497b46642ed3f64262bb26bbba2f6ecc_02d1bdd5
    0
    77f5e493-5e9b-11e3-9ef4-00219b4a7172
    0
    On answers.microsoft.com, Girish M (Support Engineer who eventally directed me here), asked me to run Scanpst.exe. I would paste the results here, but this window does not seem to allow pasting. A summary description of what it found on her .ost file (no
    .pst in use) is basically this:
    **Beginning NDB recovery
      **Attempting to open database
      **Attempting to validate header
      **Attempting to validate AMap
      **Attempting to validate BBT
      **Attempting to validate NBT
      **Attempting to validate BBT refcounts
        ??Couldint find BBT entry in the RBT (E025CC)
      **Attempting to validate header NID high-water marks
    **Beginning PST/OST recovery
      **Attempting to recover all top-level objects
        **Store created by biuld: 15.4517
      **Attempting to walk all folders
          Failed to add row to the FLT, RowID = 719
          Failed to add row to the FLT, RowID = 6CD
          Failed to add row to the FLT, RowID = 6DE
          Failed to add row to the FLT, RowID = 6D8
    and so on, and so on, with a few hundred more FLT RowID errors, finally ending with:
      **Attempting to locate any orphaned folders/messages
      **Performing Final HMP validation
      **Attempting to check top-level objects for consistency
      **Updating folder hierarchy
      **Verifying message moves
    My understanding of the Scanpst.exe process is that it also disables any addons which might cause crashing, but the issue is still being experienced. Running Scanpst.exe a second time (appending the previous log, although it seemed to actually prepend the
    file) only returned a few lines from the top of the result above ending with "Attempting to validate BBT."
    Fixes not attempted yet that I have found performing searches include running the Office Repair tool, or checking for KB2817631 (a Word update that is apparently having adverse affects on Outlook, not attempted yet because it seems to be related to the wwlib.dll
    error, which is not happening here).
    Any thoughts out there? Thanks!

    Mavis,
    Thanks for the reply. Running Outlook using /cleansharing and
    /cleanroamedprefs did not have any effect when used individually or in combination with each other.
    Running the Search Index Rebuild option also did not seem to do anything, as the pop-up message indicated that it may take a long time to finish, and yet seemed to finish instantaneously, not giving any indication that the indexing took place. The option
    window immediately said "Indexing complete" for 23,755 items.
    As to the Outlook Forum, they are the ones who directed me to this forum (you can see the thread on the Answers support page under Office - Office 2013 - Microsoft Office Outlook - Office on Windows 7, under the title "Outlook 2013 restarts when
    opening Calendar Search result item" first posted on Dec 11, 2013), as Girish M felt that it might be due to Exchange, and not Outlook. (I have no reports of any of our other users on the same Exchange server having the problem with their Outlook, but
    they also do not use it the way this user has been.)
    I can repost the issue there, or continue the same thread, if you think the issue lies with them. Was the "Answers" site the improper place to post, perhaps? Should it go in a different thread on Technet instead?
    Thanks for your assistance!
    Edited to add:
    Here are the KBs installed just before or on the date the problem started (12/6/2013):
    12/5/2016 (Office updates, all 32-Bit):
    Security Update Office 2013 KB2768005
    Office 2013 KB2768016
    Office 2013 KB2817640
    Office 2013 KB2827228
    Security Office 2013 KB2837618
    Word 2013 KB2817631
    InfoPath 2013 KB2752078
    Office 2013 KB2817493
    Office 2013 KB2760539
    Office 2013 KB2827235
    Office 2013 KB2827225
    Security Excel 2013 KB2827238
    Office 2013 KB2760242
    Office 2013 KB2817626
    Office 2013 KB2817314
    Office 2013 KB2760610
    Access 2013 KB2768008
    Office 2013 KB2738038
    SkyDrive Pro KB2825633
    Security Office 2013 KB2817623
    Office 2013 KB2760267
    Visio Viewer 2013 KB2768338
    Office 2013 KB2827230
    OneNote 2013 KB2810016
    Office 2013 KB2827228
    Office 2013 KB2767845
    Definition Office 2013 KB2760587
    Office 2013 KB2726996
    Security Office 2013 KB2810009
    Office 2013 KB2817316
    Word 2013 KB2817631
    Lync 2013 KB2817621
    Office 2013 KB2760224
    Office 2013 KB2726954
    Office 2013 KB2817640
    Publisher 2013 KB2752097
    PowerPoint 2013 KB2817625
    Office 2013 KB2760257
    Office 2013 KB2817309
    Security Outlook 2013 KB2837618
    Visio 2013 KB2752018
    Office 2013 KB2817490
    Word 2013 KB2827218
    Office 2013 KB2760553
    12/6/2013 (for Windows, all Security):
    KB2900986
    KB2888505
    KB2876331
    KB2868725
    KB2868626
    KB2862152
    I listed all updates because there have been reported instances of a Word update causing Outlook to crash, but she is not getting the wwlib.dll error related to that KB. If you are aware of any issues with these updates, and which ones might be worth uninstalling
    in an attempt to fix, please let me know.
    Thanks again!

  • My macbook pro is running very slow with some strange mouse and window movements. The trackpad is very unresponsive and when responding the cursor moves on its own and/or very erratically. When on safari the window suddenly zooms in or highlights words.

    My macbook pro is running very slow with some strange mouse and window movements. The trackpad is very unresponsive and when responding the cursor moves on its own and/or very erratically. When on safari the window suddenly zooms in or highlights words and looks them up via dictionary. I currently have a wireless mouse connected and I am still having the same problems.
    I fee like I may have a virus or my laptop is perhaps being accessed remotely. All of the sharing options are unchecked.
    HELP PLEASE
    Very worried!!

    Try these in order testing your system after each to see if it's back to normal:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the computer and
         after the chime press and hold down the OPTION key until the boot manager screen appears.
         Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
         Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).
    4. Reinstall Lion/Mountain Lion, Mavericks: Reboot from the Recovery HD. Select Reinstall Lion/Mountain Lion, Mavericks from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).

  • HT5616 I have multiple phones and iPads and all are linked to one iCloud account and one iTunes Account.  I want to keep the same iTunes Account so I can share music, etc., however, I want each device to have its own iCloud account.  How do I do this?

    I have multiple phones and iPads and all are linked to one iCloud account and one iTunes Account.  I want to keep the same iTunes Account so I can share music, etc., however, I want each device to have its own iCloud account.  Any help on how I can I do this?

    You'll need to create an Apple ID for each device. Use the new Apple ID for FaceTime, iMessage and iCloud on the device. Use the original Apple ID for Settings>iTunes & App Store.

  • Can anyone explain the split and overlapping date ranges in PHOTO moments.  I would have expected each date to have its own slot.  What logic is used for deciding which photos to include and where to split them?

    iPad Air iOS 8.1 Stock Photo App.  14000 Photos. Overlapping date ranges in Moments.  What is the criteria used for deciding after import where photos are included in Moments.  I was expecting each day to have its own exclusive slot for example, not 26 - 27 January 2007 with 8 photos then 27 January 2007 1 photo.  Why is there not two seperate slots, one for the 26th and one for 27th??   This makes locating photos by day more arkward than it need be and seems to follow no logic.  This occurs over 150 times and is very confusing.  Is this an issue or expected behaviour?

    iPad Air iOS 8.1 Stock Photo App.  14000 Photos. Overlapping date ranges in Moments.  What is the criteria used for deciding after import where photos are included in Moments.  I was expecting each day to have its own exclusive slot for example, not 26 - 27 January 2007 with 8 photos then 27 January 2007 1 photo.  Why is there not two seperate slots, one for the 26th and one for 27th??   This makes locating photos by day more arkward than it need be and seems to follow no logic.  This occurs over 150 times and is very confusing.  Is this an issue or expected behaviour?

  • Hi Just been into the apple store and the assistant told me about Pages / Keynote and Numbers for mac that can be downloaded for free. When I've searched on the app store there is only a paid version! can anyone confirm that there is a free version?

    Hi Just been into the apple store and the assistant told me about Pages / Keynote and Numbers for mac that can be downloaded for free. When I've searched on the app store there is only a paid version! can anyone confirm that there is a free version?

    See Apple Up-To-Date Program
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=429&mforum=iworktips ntrick
    Make sure your Mac is set to English before you go to the App Store.
    Be warned however thast Pages 5, with a few exceptions is actually a downgrade with over 90+ features removed:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&mforum=iworktipsn trick
    Peter

  • When I try to record videos, the camera doesn't pick up my voice. Is it because I have over 1000 pics/vids?? Because Siri can hear me when I talk to her.... It only doesn't work on videos

    When I try to record videos, the camera doesn't pick up my voice. Is it because I have over 1000 pics/vids?? Because Siri can hear me when I talk to her.... It only doesn't work on videos

    Hi colin3!
    It sounds like you could be having an issue with one of the microphones on your iPhone 5. Your iPhone 5 has three microphones that function together and separately, depending on what is using them.
    Apple - iPhone 5 - It’s so much more. And so much less, too.
    http://www.apple.com/iphone/features/
    Enhanced audio on iPhone 5.
    Apple EarPods are just the beginning of the improved audio experience on iPhone 5. It’s designed with three microphones: one on the front, one on the back, and one on the bottom. The front and back mics work together to achieve beamforming — a technique that helps iPhone focus on sound from the desired location for clearer audio. New noise-canceling technology reduces background noise. So when you hold iPhone up to your ear in a loud room, you hear what matters most: the voice on the other end.
    There is an article available that can help you troubleshoot the issue a little further and can guide you to some next steps. That article can be found here:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Thanks for being a part of the Apple Support Communities!
    Regards,
    Braden

  • Each exception class in its own file????

    Hi, I am still quite new to java, and I don't fully understand exceptions. Could you please tell me if for each exception class you require do you have to have a a seperate file. e.g. I'm creating my own array exceptions classes.
    The following is the structure:
    ** The base array exceptions class
    public class arrayException extends Exception {
    public arrayException () { super(); }
    public arrayException (String s) { super(s); }
    ** The outofboundsArrayException
    public class outofboundsArrayException extends arrayException {
    public outofboundsArrayException ()
    { super("Number entered is out of bounds"); }
    public outofboundsArrayException (String s)
    { super(s); }
    ** The fullArrayExceptiom
    public class fullArrayException extends arrayException {
    public fullArrayException ()
    { super("The array is full"); }
    public fullArrayException (String s)
    { super(s); }
    So will the three classes above need their own file.
    I wanted to also know what the super does. I thought when the exception was raised, the text message in the super method is outputted, but i've tested that and it doesn't output (e.g. the error message "The array is full" doesn't output). The only thing that outputs is what you put in the catch part.
    Thank You very Much!

    Could you please tell me if
    for each exception class you require do you have to
    have a a seperate file.Yes. Exception classes are like any other public class in Java, in that it must be in its own file with the standard naming conventions.
    I wanted to also know what the super does. I thought
    when the exception was raised, the text message in
    the super method is outputted, but i've tested that
    and it doesn't outputsuper([0,]...[n]) calls a constructor in the superclass of your current class matching the signature super([0,]...[n]). In this particular case, the Exception's message property is being set by the parent constructor. If you were to leave out super([0,]...[n]), the default no-arg constructor of the superclass would be invoked, and the message would not be set.
    Use the getMessage() method of the Exception class to return the message value in later references to your object.

  • My ipad air will not charge when connected to any outlet with its own cable and plug.

    I had this Ipad Air since March 2014 and always kept it updated and charged, but since three days ago it does not seems to like its own charging cable and plug that came with it. I tried different outlets and other cords and plugs. I closed and restarted it, but no result. Now it is off because of no battery power. What can it be?

    Try the following:
    Option 1
    1. Settings>Airplane Mode>ON
    2. Turn the iPad OFF
    3. Leave unit off for about 20 seconds. 
    4. Turn the iPad back on and it should now show "charging"
    5. Turn Aeroplane Mode OFF
    Option 2
    Reset iPad and when the apple logo shows up, plug in the charger.

  • How do I get my entire site to come up when someone clicks search results of just one page of my sit

    When someone searches for my site in google, sometimes only one page of  my site comes up. If they click it, they may only get my menubar, or a  page, such as my calendar page without a menubar or topbar. How can I  make it so when they click the link my entire site comes up. even if the  search they did just lists one of my pages? Help... Thanks

    Are you using FRAMES?
    If not, you need to post a link to your site.

  • My I phone 4 will boot me out of a web site and there are time when it just shuts down on its own,also it take forever to load my game. What would cause these issues?

    My I phone 4 will take forever to load a game, boot me out of a web site and sometimes shut down on its own. What would cause these issues

    Hello Jake69529,
    The following article details some useful troulbeshooting that can help get your iPhone's apps stabilized.
    iOS: An app you installed unexpectedly quits, stops responding, or won’t open
    http://support.apple.com/kb/TS1702
    Cheers,
    Allen

  • When exporting to epub, only about 1/3 of my chapters are getting the page breaks. Each chapter is in its own doc, and I've tried splitting it apart by doc. and by H1, with no luck. HELP

    All my paragraph styles seem to jive, and no matter what I do, most of my chapters seem to miss their page breaks. I've heard of others having this issue with older versions of Indesign, but I'm on CC2014, and I thought that should be fixed by now. I really don't want to have to learn HTML code and go break open the epub doc to fix it manually, because that doesn't always work across all devices either.  I know others have to of  run into this problem before. What am I doing wrong?

    Make sure the paragraph style applied to the chapter title (if that's the first line of each chapter) is tagged. Open the paragraph style and go to Export Tagging and check Split Document (epub only). Then when you export (assuming you are using reflowable) under General>Split Document check Based on Paragraph Style Export Tags. Try it and let us know if this helps.

  • Using iPad 3' and Safari, when doing google search, resulting hyperlinks will not open. Will only open in new tab.

    I am using an iPad3, with OS 5.1. As of 16th April when I do a Google search (whilst running Safari), none of the resulting hyperlinks will work. If I open the link in a new tab it will work, but this is very inconvenient. Anyone got an answer to this problem? Thanks in advance.

    Although I thought the hyperlink problem was solved I then started to get problems with page size settings. I was having to manualy expand the text on most pages, and links within some internet sites like Amazon for editing wish lists, or buying products would not work. So I changed "open new tabs in background" back to ON, then cleared cookies, settings and history in my Safari settings. All page size and links back to normal now - hope it lasts a bit longer than last fix.

  • When clicking on search results in google or yahoo, I am automatically forwarded to some spam or ad site

    When I search in Google or Yahoo, if I click on the results of a search I am automatically sent to a spam or ad site and not the url that I click on. I can copy and paste the URL into my browser but it will not let me click. Same results in Firefox or Internet Explorer. None of my spyware including Norton, Malwarebytes or superspyware has found the problem.

    Your issue may be caused by Malware. You can run and update the following '''free''' antivirus software:
    1. Malwarebytes (Free version) - http://www.malwarebytes.org
    2. Spybot Search & Destroy - http://www.safer-networking.org
    3.Spyware Terminator - http://www.spywareterminator.com
    In addition, there are a number of forums you can use to help get rid of your infection. These include:
    *[http://www.bleepingcomputer.com/forums/ Bleeping Computer]
    *[http://forums.spybot.info/ Safer-Networking Forums]
    *[http://www.spywarewarrior.com/index.php Spyware Warrior Forums]
    *[http://www.spywarewarrior.com/index.php SpywareInfo Forums]

  • Mail search result to its threaded discussion?

    When I find an individual Apple Mail from search, I'd like to open that email in the threaded context. What is the easiest way to do this?

    Right click on the photo and select Show Event from the contextual menu:
    Click to view full size
    Then in the next window you can click on All Events and you'll go back to the Event window with that event selected.
    OT

Maybe you are looking for

  • Records added into the DB when deleting row in List

    I have a list with an add button at the bottom. Every entry has a delete button on the left. Whenever I create new entries and then delete some rows, the newly created entries are automatically saved. How can I solve this? Deleting calls getOADBTrans

  • How can I make swatches larger?

    How can I make the swatches in the Swatches Panel larger? On my screen each swatch is only slightly larger than an ant. Illustrator and Photoshop let you make the swatches larger from the panel's flyout menu, but I don't see that in Flash (CS5). Is t

  • How do I label a frame

    I am using Director 8 and I am trying to figure out how to label a frame. I already know how to create markers, but I can not find how to makers. I am creating a electronic report and I want to have auto numbering. I have markers 1 thru 50 with three

  • 8i on SuSE 6.2 - Do I need to apply the glibc patch?

    According to the documentation, there is a glibc patch that must be applied. Does anyone know if this applies to the just released SuSE 6.2? null

  • Silverlight dosen't work at Firefox 18.0.2 on linux ubuntu 12.10

    Silverlight (Moonlight, in fact) dosen't work at Firefox 18.0.2 on linux ubuntu 12.10.