0 Replies Latest reply on Feb 4, 2008 1:58 AM by The Wizard Woods

    Combobox and sending to email

    The Wizard Woods
      Hello there,

      I have created an enquiry form, and all the normal fields work and when the send button is pressed i get the email with all fields filled in, the only thing that doesnt show is my combobox frop down function, very frustrating :-) I would be very grateful if anyone can shed any light on this for me.

      Below i have laid out exactly what code i am using:

      Flash Actionscript code:

      Combobox:
      On an Actions layer:
      // Add Item to List.
      this.comboBox_reformat.addItem({data:1, label:"Item1"});
      this.comboBox_reformat.addItem({data:2, label:"Item2"});
      this.comboBox_reformat.addItem({data:3, label:"Item3"});
      this.comboBox_reformat.addItem({data:4, label:"Item4"});
      this.comboBox_reformat.addItem({data:5, label:"Item5"});
      this.comboBox_reformat.addItem({data:6, label:"Item6"});
      this.comboBox_reformat.addItem({data:7, label:"Item7"});
      // Create Listener Object.
      var cbListener:Object = new Object();
      // Assign function to Listener Object.
      cbListener.change = function(event_obj:Object) {
      trace("Value changed to: "+event_obj.target.selectedItem.label);
      lv.combo = event_obj.target.selectedItem.label;
      };
      // Add Listener.
      this.comboBox_reformat.addEventListener("change",c bListener);
      myButton.onRelease = function():Void{
      var lv:LoadVars = new LoadVars();
      lv.combo = comboBox_reformat.selectedItem.label;
      lv.sendAndLoad("email.php", lv, "POST");
      }

      Send Button:

      on (release) {
      form.loadVariables("email.php", "POST");
      }

      And finally...

      PHP CODE:
      <?php
      $sendTo = "??@?????????.co.uk";
      $subject = "Title";

      $headers = "From: " . $_POST["name"] ." <" . $_POST["email"] .">\r\n";
      $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
      $headers .= "Return-path: " . $_POST["email"];

      $message = "Name: " . $_POST["name"] . "\r\n" .
      "Company: " . $_POST["company"] . "\r\n" .
      "Email: " . $_POST["email"] . "\r\n" .
      "Address 1: " . $_POST["address1"] . "\r\n" .
      "Address 2: " . $_POST["address2"] . "\r\n" .
      "Town: " . $_POST["town"] . "\r\n" .
      "Phone: " . $_POST["phone"] . "\r\n" .
      "Post Code: " . $_POST["postcode"] . "\r\n" .
      "Interested in: " . $_POST["combo"] . "\r\n" .
      "Message: " . $_POST["message"];

      mail($sendTo, $subject, $message, $headers);
      ?>

      So this is where i have got too, your thoughts and guidance welcomed.