8 Replies Latest reply on Dec 12, 2008 3:06 PM by The Wackonerd

    Combobox whit multiple selection in dependent drop down HELP!

      Hi, try to explain my problem: Have two table on mysql, one for category and second for subcategory. Put on my webpage a dependent drop down menu, and this work fine if choose only ONE ITEM, but if i want select Two or more SUBCATEGORY the Value sent to mysql from form was wrong.

      ex: 1 step1 Pictures, Images and Photos

      like example when click submit the value from form is:
      SERT INTO scheda_docenti VALUES ('', 'ff', 'ff', '', '', '', '', '12', 'Roma', '', '6', 'Preparazione psicologica')

      "6" is the value of category and "Preparazione psicologica" is the value of subcategory, but was lost "Motivazione".
      If a change POST whit GET method i take this: Put_IN_docenti_Conn.php?ID_scheda_docenti=&materia_insegnata=6&sub_materie=Motivazione&su b_materie=Preparazione+psicologica

      How You can look, the field "sub_materie" was repeat two time, but i have in mysql only one field for receive this data.

      Well i want put two Value like (&sub_materie=valueOne,ValueTwo) in one field of my DB. Can some guy help me?
        • 1. Re: Combobox whit multiple selection in dependent drop down HELP!
          Günter Schenk Level 4
          Hi and buon giornio da Germania,

          according to an answer provided in a similar thread on the Interakt forums "the Dependent Dropdown doesn't permit multiple select (list) and it doesn't keep related values for multiple selected items as you need it. Also the Dependent Dropdown is limited from its interface to not be bind to a dropdown displayed as a list with the multiple or simple selection".

          For storing multiple values as comma-separated array you´d have to use ADDT´s "Comma-separated Checkboxes" or "Comma-separated Menu" behaviours.

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Combobox whit multiple selection in dependent drop down HELP!
            Level 1
            Thanks GUNTER for quick answer, german people = nice people! Ok but one ask more. Was put dependent drop down wizard and then modified "Menu" to "list menu" whit multiple allow.
            Now if i change Dependent Dropdown whit Comma-separated Menu or Checkboxes, was lost the dependent act from Category?

            I need simply select one menu Whit Category (retrieve from db) and then opportunity to select one or more appropriate subcategory also (retrieve from db).

            what suggest axactly? Sehr Dank für Sie mögliche Antwort
            • 3. Re: Combobox whit multiple selection in dependent drop down HELP!
              Günter Schenk Level 4
              -------
              Now if i change Dependent Dropdown whit Comma-separated Menu or Checkboxes, was lost the dependent act from Category?
              -------

              that´s correct, because the Comma-separated Menu or Checkboxes are not "dependant" on other form elements

              ------
              what suggest axactly?
              ------

              Bo, non lo so ;-) The only idea I can come up with is to...

              a) let the user select the main "category" value on the "insert.php" page

              b) don´t display the "category" menu on the "update.php" page, but provide an array of Comma-separated Checkboxes array -- the underlying recordset for this "subcategory" Comma-separated Checkboxes - instance could be defined to relate to the already submitted "category" value.

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Combobox whit multiple selection in dependent drop down HELP!
                Level 1
                WAW Günter Schenk, im sure that you know story like "italian people find always solution"?
                NOW I CAN SELECT MULTIPLE ITEMS FROM DEPENDENT DROP DOWN MENU/LISTITEM.

                Well the SOLUTION is BRACKET and the php IMPLODE string.
                explain:

                select name="sub_materie[]" size="5" multiple="multiple" id="sub_materie" wdg:subtype="DependentDropdown" wdg:type="widget" wdg:recordset="RecordsetMicroMaterie" wdg:displayfield="sub_materie" wdg:valuefield="sub_materie" wdg:fkey="codice_macro","CommaMenu" wdg:triggerobject="materia_insegnata">
                /select

                1) just add [] in select name, but noT finish...
                Now must put variable in mysql/php variable.
                2) ?php
                $user = "user";
                $pass = "pass";
                $db = "db";

                $materia_insegnata=$_POST['materia_insegnata'];
                $sub_materie=$_POST['sub_materie'];
                $sub_materie_string = implode(",", $sub_materie);

                mysql_connect(localhost,$user,$pass);
                @mysql_select_db($db) or die(mysql_error());
                $query = "INSERT INTO scheda_docenti VALUES ('', '$materia_insegnata',
                '$sub_materie_string',
                ?php

                thats all right AND NOW I CAN SEE ON MY RETRIEVE PHP PAGE THIS:
                step2 Pictures, Images and Photos .

                THANKS A LOT FOR YOUR HELP AND HOPE THIS TRICK HELP SOMEGUY.

                CIAO SANDRO
                • 5. Re: Combobox whit multiple selection in dependent drop down HELP!
                  Günter Schenk Level 4
                  Ciao Sandro,

                  hey, this is indeed one of the greatest tipps ever provided by ADDT users -- congratulations !!

                  ------
                  HOPE THIS TRICK HELP SOMEGUY
                  ------

                  yes, this should help *plenty* of users :-)

                  ------
                  im sure that you know story like "italian people find always solution"?
                  ------

                  normalmente solo la gente dell mezzogiorno ;-)

                  Cheers,
                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Combobox whit multiple selection in dependent drop down HELP!
                    Level 1
                    CIAO Günter Schenk,

                    Sei molto simpatico e penso tu sia della germania del sud. Sbaglio?
                    Io sono di Roma, ma trovo comunque soluzioni.

                    need translation?

                    ciao alla prossima soluzione.
                    • 7. Re: Combobox whit multiple selection in dependent drop down HELP!
                      Günter Schenk Level 4
                      Ciao Sandro,

                      vivo vicino Colonia rispettivamente Dusseldorf, la citta si chiama "Wuppertal"

                      -------
                      ciao alla prossima soluzione
                      -------

                      a domani ! :-)

                      Cheers,
                      Günter Schenk
                      Adobe Community Expert, Dreamweaver
                      • 8. Re: Combobox whit multiple selection in dependent drop down HELP!
                        The Wackonerd
                        Hi sundsx
                        I am trying to do the same thing but bring a bit slow I am having trouble following your instructions, have you got this in a tutorial?

                        Günter, maybe you can help me out on this please

                        thanks