Multiple selections in Combobox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • wtrd
    Sergeant First Class

    • Apr 2007
    • 51

    Multiple selections in Combobox

    Hi, my domain is www.4cyberbiz.com

    My previous thread seems to have been deleted for some reason.

    When using a Combobox and opting for 'multiple selections', this does not seem to work when the form comes through on email.

    If say four selections are made on the web page, only one selection comes through on the email form.

    Any ideas what I may be doing wrong. I have tried different options with no success.

    Regards

    Stuart
  • Andy128
    Major General

    • Dec 2005
    • 2317

    #2
    Re: Multiple selections in Combobox

    Yes it can be done. Could you please cut and paste the php code you are currently using in this thread. In order to get multiple variables from the form, it has to be modified. Once you paste that, we can write on for you and give you instructions on how to make it work.

    Andy
    PHP- is a blast!

    Comment

    • wtrd
      Sergeant First Class

      • Apr 2007
      • 51

      #3
      Re: Multiple selections in Combobox


      Ref: www.4cyberbiz.com

      Hi, thanks for your response. The html code on the php page is as below.

      I also have other pages with the same problem, so if you could advise what to insert and how to action it would be helpful.

      Thank you.

      ================================================== ====
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
      <title>reader</title>
      <meta name="GENERATOR" content="Created by BlueVoda">
      </head>
      <body bgcolor="#000000" text="#FFFFFF">
      <?PHP
      $mailto = "wtrd@slingshot.co.nz";
      $email = $HTTP_POST_VARS['email'];
      if ($email == "") {
      $email = $mailto;
      }
      $mailsubj = "Desktop Reader Request for TDI";
      $mailhead = "From: $email\n";
      reset ($HTTP_POST_VARS);
      $mailbody = "Values submitted from web site form :\n";
      while (list ($key, $val) = each ($HTTP_POST_VARS))
      {
      if ($key!="submit")
      {
      $mailbody .= "$key : $val\n";
      }
      }
      mail($mailto, $mailsubj, $mailbody, $mailhead);
      ?>
      <div id="bv_" style="position:absolute;left:174px;top:81px;width :483px;height:192px;z-index:0" align="center">
      <font style="font-size:21px;BACKGROUND-COLOR:#FFFF00" color="#000000" face="Arial">Thank you for requesting to be a subscriber to our Desktop Direct Offers service. Please 'click' on the 'Download Reader link below to enable you to the get the very latest of offers/requests which have passed our due diligence process, delivered DIRECT TO YOUR DESKTOP without needing to check your email. You will also be sent a back-up copy via email</font></div>
      <div id="bv_" style="position:absolute;left:75px;top:385px;width :710px;height:42px;z-index:1" align="left">
      <font style="font-size:24px" color="#0000FF" face="Arial"><u>&lt;<a href="http://downloads.desktopsubscriber.com//reader/win/763/1070" target="_self">http://downloads.desktopsubscriber.com//reader/win/763/1070</a>&gt;</font><font style="font-size:16px" color="#000000" face="Times New Roman"></u><br>
      </font></div>
      </body>
      </html>

      Comment

      • Andy128
        Major General

        • Dec 2005
        • 2317

        #4
        Re: Multiple selections in Combobox

        My apologies.... I need the link to the form in question to get the form field names to do the script.

        Andy
        PHP- is a blast!

        Comment

        • wtrd
          Sergeant First Class

          • Apr 2007
          • 51

          #5
          Re: Multiple selections in Combobox

          Ref: www.4cyberbiz.com

          Dear Andy

          Here is the link below for the form in question



          I have six other similar type forms which I also need to do multiple selections, so maybe once you have done this one I can do the rest? Please advise on this point.

          Regards

          Stuart

          Comment

          • Andy128
            Major General

            • Dec 2005
            • 2317

            #6
            Re: Multiple selections in Combobox

            Stuart-
            Yes, you could use my script and change it to suit your needs.

            So to begin. On your form you need to add two things. So open the page that the form is on with the BV web builder. Go to the "I want to receive OFFIERS on" field and open it. Next to the name I need you to put the square brackets [ ] So it should look like this when your done;

            Receive OFFERS on[]

            Do the same for the "I want to receive REQUESTS for" field
            Receive REQUESTS for[]

            Now- delete the php code you have placed in reader.php and then copy
            the code below and paste it in its place;

            <?php
            $First name $_POST['First name'];
            $Last name $_POST['Last name'];
            $Landline number $_POST['Landline number'];
            $Company name $_POST['Company name'];
            $Email $_POST['Email'];
            $Mobile $_POST['Mobile'];
            $Skype $_POST['Skype'];
            $Msn $_POST['Msn'];
            $Best time $_POST['Best time'];
            $Years in business $_POST['Years in business'];
            $non-circulation $_POST['non-circulation'];
            $Receive OFFERS on $_POST['Receive OFFERS on'];
            $Receive OFFERS on implode("," , $Receive OFFERS on);
            $Receive REQUESTS for $_POST['Receive REQUESTS for'];
            $Receive REQUESTS for implode("," , $Receive REQUESTS for);

            //------Organize data to mail-----------
            //
            $mailto = "wtrd@slingshot.co.nz";
            $Email = $_POST['Email'];
            if ($Email == "")
            {
            $Email = $mailto;
            }
            $mailsubj = "Desktop Reader Request for TDI";
            $mailhead = "From: $email\n";
            $mailbody = "Values submitted from web site form :\n"
            ."--------------------------------------------------\n"
            ."First Name: $First name\n"
            ."Last Name: $Last name\n"
            ."Land Line: $Landline number\n"
            ."Company: $Company name\n"
            ."Email: $Email\n"
            ."Mobile: $Mobile\n"
            ."Skype: $Skype\n"
            ."MSN: $Msn\n"
            ."---------------------------------------------------\n"
            ."Best time to call: $Best time\n"
            ."Years in Business: $Years in business\n"
            ."---------------------------------------------------\n"
            ."Non Circulation Agreement: $non-circulation\n"
            ."---------------------------------------------------\n"
            ."Recieve Offers on: $Receive OFFERS on\n"
            ."---------------------------------------------------\n"
            ."Recieve Requests For: $Receive REQUESTS for\n";
            //End of Data
            //
            //Now lets mail the info
            mail($mailto,$mailsubj,$mailbody,$mailhead);
            ?>

            Save and publish both pages. Give it a whirl.

            Cheers-

            Andy
            PHP- is a blast!

            Comment

            • wtrd
              Sergeant First Class

              • Apr 2007
              • 51

              #7
              Re: Multiple selections in Combobox

              Ref: www.4cyberbiz.com

              Dear Andy

              Thanks for your prompt response and I will give that a try!

              Regards

              Stuart

              Comment

              • wtrd
                Sergeant First Class

                • Apr 2007
                • 51

                #8
                Re: Multiple selections in Combobox

                Ref: www.4cyberbiz.com

                Hello Andy.

                The below error message is coming up when the form is submitted:

                Parse error: syntax error, unexpected T_STRING in /home/mdbnnbpw/public_html/tdi/reader.php on line 2

                Please advise. I noticed that I had the Name in First Name with a capital N in the edit box, however changed this on the site but with still same result.

                Regards


                Stuart

                Comment

                • Andy128
                  Major General

                  • Dec 2005
                  • 2317

                  #9
                  Re: Multiple selections in Combobox

                  Let me take a quick look.......

                  Yeah- I hadn't noticed the capital "N"........... Also I forgot the "=" sign to assign value to variables..DUH (late night prgraming) I feel like and idiot.

                  so, copy/paste the code below in place of the other code and then SAVE/PUBLISH.

                  Test and let me know.

                  <?php
                  $First Name =$_POST['First Name'];
                  $Last name =$_POST['Last name'];
                  $Landline number =$_POST['Landline number'];
                  $Company name =$_POST['Company name'];
                  $Email =$_POST['Email'];
                  $Mobile =$_POST['Mobile'];
                  $Skype =$_POST['Skype'];
                  $Msn =$_POST['Msn'];
                  $Best time =$_POST['Best time'];
                  $Years in business =$_POST['Years in business'];
                  $non-circulation =$_POST['non-circulation'];
                  $Receive OFFERS on =$_POST['Receive OFFERS on'];
                  $Receive OFFERS on =implode("," , $Receive OFFERS on);
                  $Receive REQUESTS for =$_POST['Receive REQUESTS for'];
                  $Receive REQUESTS for =implode("," , $Receive REQUESTS for);

                  //------Organize data to mail-----------
                  //
                  $mailto = "wtrd@slingshot.co.nz";
                  $Email = $_POST['Email'];
                  if ($Email == "")
                  {
                  $Email = $mailto;
                  }
                  $mailsubj = "Desktop Reader Request for TDI";
                  $mailhead = "From: $email\n";
                  $mailbody = "Values submitted from web site form :\n"
                  ."--------------------------------------------------\n"
                  ."First Name: $First Name\n"
                  ."Last Name: $Last name\n"
                  ."Land Line: $Landline number\n"
                  ."Company: $Company name\n"
                  ."Email: $Email\n"
                  ."Mobile: $Mobile\n"
                  ."Skype: $Skype\n"
                  ."MSN: $Msn\n"
                  ."---------------------------------------------------\n"
                  ."Best time to call: $Best time\n"
                  ."Years in Business: $Years in business\n"
                  ."---------------------------------------------------\n"
                  ."Non Circulation Agreement: $non-circulation\n"
                  ."---------------------------------------------------\n"
                  ."Recieve Offers on: $Receive OFFERS on\n"
                  ."---------------------------------------------------\n"
                  ."Recieve Requests For: $Receive REQUESTS for\n";
                  //End of Data
                  //
                  //Now lets mail the info
                  mail($mailto,$mailsubj,$mailbody,$mailhead);
                  ?>









                  Andy
                  PHP- is a blast!

                  Comment

                  • wtrd
                    Sergeant First Class

                    • Apr 2007
                    • 51

                    #10
                    Re: Multiple selections in Combobox

                    Ref: www.4cyberbiz.com

                    Dear Andy

                    Same error message has come up again. At the moment have changed it back to original code where I can only select one.

                    I am not sure if we are thinking on the 'same page' though.

                    From the 'Receive Offers from' combobox, all I want to do is choose say multiples of the ones listed in that specific box. The code you have done seems to encompass the whole form, however perhaps that is necessary to just get multiple selections in that one box.

                    Originally I thought it was as simple as selecting 'multilple selections' when creating the combobox and then when selecting on the website to then highlight multiple selections from that one specific box (using Ctrl key) and then the multiple selections would come through on the Form to email.

                    Please let me know your comments.

                    Regards

                    Stuart

                    Comment

                    • Andy128
                      Major General

                      • Dec 2005
                      • 2317

                      #11
                      Re: Multiple selections in Combobox

                      Ok- I have copied your form. Tested it and the script and it works now.

                      There were a couple errors on my part for which I apologize. But- on your form, you did not put the [ ] after the names I had showed.

                      So.............first, go back up and look a the instructions for the [] after the specific field names I stated.

                      Second- change the name fields so there are no spaces like below;
                      FirstName
                      Lastname
                      Landlinenumber
                      Companyname
                      Email
                      Mobile
                      Skype
                      Msn
                      Besttime
                      Yearsinbusiness
                      noncirculation
                      ReceiveOFFERSon
                      ReceiveREQUESTSfor

                      Then- copy and paste this code where the old one was.

                      <?php
                      $FirstName =$_POST['FirstName'];
                      $Lastname =$_POST['Lastname'];
                      $Landlinenumber =$_POST['Landlinenumber'];
                      $Companyname =$_POST['Companyname'];
                      $Email =$_POST['Email'];
                      $Mobile =$_POST['Mobile'];
                      $Skype =$_POST['Skype'];
                      $Msn =$_POST['Msn'];
                      $Besttime =$_POST['Besttime'];
                      $Yearsinbusiness =$_POST['Yearsinbusiness'];
                      $noncirculation =$_POST['noncirculation'];
                      $ReceiveOFFERSon =$_POST['ReceiveOFFERSon'];
                      $ReceiveOFFERSon =implode("," , $ReceiveOFFERSon);
                      $ReceiveREQUESTSfor =$_POST['ReceiveREQUESTSfor'];
                      $ReceiveREQUESTSfor =implode("," , $ReceiveREQUESTSfor);

                      //------Organize data to mail-----------
                      //
                      $mailto = "wtrd@slingshot.co.nz";
                      $Email = $_POST['Email'];
                      if ($Email == "")
                      {
                      $Email = $mailto;
                      }
                      $mailsubj = "Desktop Reader Request for TDI";
                      $mailhead = "From: $Email\n";
                      $mailbody = "Values submitted from web site form :\n"
                      ."--------------------------------------------------\n"
                      ."First Name: $FirstName\n"
                      ."Last Name: $Lastname\n"
                      ."Land Line: $Landlinenumber\n"
                      ."Company: $Companyname\n"
                      ."Email: $Email\n"
                      ."Mobile: $Mobile\n"
                      ."Skype: $Skype\n"
                      ."MSN: $Msn\n"
                      ."---------------------------------------------------\n"
                      ."Best time to call: $Besttime\n"
                      ."Years in Business: $Yearsinbusiness\n"
                      ."---------------------------------------------------\n"
                      ."Non Circulation Agreement: $noncirculation\n"
                      ."---------------------------------------------------\n"
                      ."Recieve Offers on: $ReceiveOFFERSon\n"
                      ."---------------------------------------------------\n"
                      ."Recieve Requests For: $ReceiveREQUESTSfor\n";
                      //End of Data
                      //
                      //Now lets mail the info
                      mail($mailto,$mailsubj,$mailbody,$mailhead);
                      ?>


                      Then Save and Publish and then test.

                      Andy
                      PHP- is a blast!

                      Comment

                      • wtrd
                        Sergeant First Class

                        • Apr 2007
                        • 51

                        #12
                        Re: Multiple selections in Combobox

                        Ref: www.4cyberbiz.com

                        Dear Andy

                        Still no good!

                        I was first getting the following error messages:

                        Warning: implode() [function.implode]: Invalid arguments passed in /home/mdbnnbpw/public_html/tdi/reader.php on line 14

                        Warning: implode() [function.implode]: Invalid arguments passed in /home/mdbnnbpw/public_html/tdi/reader.php on line 16


                        ....Then I managed to get the scrip through ok but the message was saying 'array' in the Request Offers box, whatever was selected

                        .....and now the form will not even come through to my email and I have not changed anything.

                        If I change it back to original (as showing now)the form comes through fine with the selections.... just not the multiple ones which was the original intention.

                        I think I may just have to use check boxes for each category as the scrip just does not want to seem to work properly and this is taking up too much time.

                        Regards

                        Stuart

                        Comment

                        • navaldesign
                          General & Forum Moderator

                          • Oct 2005
                          • 12080

                          #13
                          Re: Multiple selections in Combobox

                          Use Advanced BlueVoda Form Processor . It will take care automatically of everything.
                          Navaldesign
                          Logger Lite: Low Cost, Customizable, multifeatured Login script
                          Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                          DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                          Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                          Comment

                          • wtrd
                            Sergeant First Class

                            • Apr 2007
                            • 51

                            #14
                            Re: Multiple selections in Combobox

                            Thank you! I will take a look.

                            Comment

                            • navaldesign
                              General & Forum Moderator

                              • Oct 2005
                              • 12080

                              #15
                              Re: Multiple selections in Combobox

                              Please note that in order for the form to submit the multiple values, the relevant field MUST have at the end (attached, no whitespaces) [] (square brackets). Also, if this is a combobox, you must tick the "Allow multiple selections" tickbox.
                              Navaldesign
                              Logger Lite: Low Cost, Customizable, multifeatured Login script
                              Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                              DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                              Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                              Comment

                              Working...
                              X