Advanced Search

Results 1 to 2 of 2

Thread: Call Animated Collapsible With Select Form

  1. #1
    Join Date
    Nov 2012
    Thanked 0 Times in 0 Posts

    Default Call Animated Collapsible With Select Form

    1) Script Title:
    Animated Collapsible
    2) Script URL (on DD):
    3) Describe problem:
    Trying to show/hide div's from <select>

    Hello, I am trying to be able to show/hide div's with a <select> form. For Example:

    <select id="e1" style="width:210px">
                        <option value="">Lost Card</option>
                        <option value="">Stolen Card</option>
                        <option value="">Damaged Card</option>
                        <option value="">Card Found By Stranger</option>
                        <option value="">Card Status</option>
    <div id="lostcard" style="width: 966px; background: transparent;border:  0;">
                            Hello im a great idea!
    And of course, in the head section:

    <script type="text/javascript" src="../js/animatedcollapse.js"></script>
            <script type="text/javascript">
            animatedcollapse.addDiv('lostcard', 'fade=0,speed=400,group=gen,hide=1,persist=0')
            animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
                    //$: Access to jQuery
                    //divobj: DOM reference to DIV being expanded/ collapsed. Use "" to get its ID
                    //state: "block" or "none", depending on state
    I am also wanting to use Select2 3.2 to make custom select menus

    Here is how the select forms are setup:

    <script src="../js/select2.js"></script>
            <script>$(document).ready(function() { $("#e1").select2({placeholder: "Cards & Service Requests", allowClear: true}); });</script>
            <script>$(document).ready(function() { $("#e2").select2({placeholder: "Transactions", allowClear: true}); });</script>
            <script>$(document).ready(function() { $("#e3").select2({placeholder: "General Call Information", allowClear: true}); });</script>
    I know the rules say you do not support other scripts but I am just showing that to show that the names of the selects are already being declared. I am new to javascript and have been trying to get this to work for the past few hours. I have gotten this to work with regular links, select forms are a completely different story.

    Any help would be greatly appreciated, and if I am missing information just let me know!

  2. #2
    Join Date
    Dec 2008
    Portsmouth, UK
    Thanked 388 Times in 383 Posts


    <select onchange="ShowDiv(this.value);">
     <option value="jason" >jason</option>
     <option value="kelly" >kelly</option>
     <option value="michael" >michael</option>
     <option value="|jason,kelly,michael" >hide: jason,kelly,michael</option>
     <option value="jason,kelly,michael" >show: jason,kelly,michael</option>
     <option value="jason|kelly,michael" >show: jason hide: kelly,michael</option>
    function ShowDiv(txt){
     var t,z0=0;
     if (txt[0]){
      var t=txt[0].split(',');
      for (;z0<t.length;z0++){[z0]);
     if (txt[1]){
      for (z0=0;z0<t.length;z0++){
    God Loves You and will never love you less.
    If my post has been useful please donate to

Similar Threads

  1. Replies: 0
    Last Post: 06-09-2009, 08:11 AM
  2. Animated Collapsible DIV v2.01 <form> submit in FF
    By ywkyee in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 01-10-2009, 04:10 PM
  3. Animated collapse call from other file
    By agehoops in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 06-19-2008, 10:14 PM
  4. Animated Collapsible Div and animated gifs
    By flangeway in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 01-22-2008, 02:57 AM
  5. Animated Collapsible DIV - Collapsible DIVs inside collapsible DIV
    By ekin in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 09-26-2007, 02:03 AM


Posting Permissions

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