Announcement

Collapse
No announcement yet.

Values in a double select

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Values in a double select

    Hello:

    How I can get the values ​​resulting from a double select?

    I have an apllication control

    Regards

  • #2
    Hello,

    Please take a look at the example and tutorial below:

    example: http://scriptcase.net/phpgenerator/s...-a-link-table/
    tutorial: http://scriptcase.net/phpgenerator/s...orm/form24.php

    regards,
    Bernhard Bernsmann

    Comment


    • #3
      Hi Bernhard, thanks for you answer

      but, how I know, inside my program, if I selected Vermont and not Maine.

      How I can get the right side of the select; if I selected Vermont and Connecticut how to get $CitiesSelected = ('Vermont','Connecticut'); which is the var name where the double select store the items selected

      Thank you :-)

      Comment


      • #4
        Your selects are stored in one string separated by a pipe character. So your {field} will contain the selected values.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          Albert:

          Excellent!!

          Thank you very much!

          Comment


          • #6
            Hi Bernhard,

            The link is broken.
            Do you have the revised link ?

            Thank's

            Originally posted by bartho View Post
            Hello,

            Please take a look at the example and tutorial below:

            example: http://scriptcase.net/phpgenerator/s...-a-link-table/
            tutorial: http://scriptcase.net/phpgenerator/s...orm/form24.php

            regards,
            Bernhard Bernsmann

            Comment


            • #7
              Somebody has another example?, I need storage in my db the double select field selected items. Also know how many items are selected. Thanks in advance.

              Comment


              • #8
                Originally posted by aducom View Post
                Your selects are stored in one string separated by a pipe character. So your {field} will contain the selected values.
                Do you have and example to call de values?

                Comment


                • #9
                  The data will be stored like 'myoption1|myption2|myoption3' if you have three items selected. So all selected elements will be stored with a separator. You can extract that from the database and use the php explode statement to form an array with individual values and process them.
                  Albert Drent
                  aducom software netherlands
                  scriptcase partner, reseller, support and (turn-key) development
                  www.scriptcase.eu / www.scriptcase.nl

                  Comment


                  • #10
                    Originally posted by aducom View Post
                    The data will be stored like 'myoption1|myption2|myoption3' if you have three items selected. So all selected elements will be stored with a separator. You can extract that from the database and use the php explode statement to form an array with individual values and process them.
                    You're right, is working.

                    The example is:
                    $result = explode('";"', str_replace(";",",",{CUPONES}));
                    $mystring = implode('","', $result);

                    $array = explode(',',$mystring);
                    $count = count($array); // array size
                    I don't exactly how this work but after many test is done.

                    Comment


                    • #11
                      you can help me too I have a similar problem:
                      I would like to memorize in the table the selections of a "double select" in my case I have two tables which are as follows:

                      "CartellaPaziente" with the following fields:
                      -------------------------------------------------- ------------ IdAccettazioneVisita int(11) Auto incremento
                      DataAccettazioneVisita date
                      CCIdPaziente int(11)
                      MotivoVisita varchar(35)
                      Ortottista varchar(35)
                      Medico varchar(35)
                      Accettazione char(2)
                      IdPatologiaF int(11)
                      Note_PatologiaF longtext
                      -------------------------------------------------- ------------
                      "tabpatanamnesif" with the following fields:
                      -------------------------------------------------- ------------ IdPatologiaF int(11) Auto incremento
                      PatologiaF varchar(25)
                      -------------------------------------------------- ------------

                      I would like to select multiple entries from the "tabpatanamnesif" table and store them in the "Patient Folder" table, as in the example I enclose. Thank you in advance for the help you will be able to give me. double_select.jpg

                      Comment


                      • #12
                        maybe can you making that whith this
                        http://www.scriptcase.net/docs/es_es...many-relation/

                        Comment

                        Working...
                        X