combo box passing value to php

  • beaner
  • Novice
  • Novice
  • beaner
  • Posts: 15

Post 3+ Months Ago

Hi All,
I have a flash form that sends information via e-mail using php. All is working fine except I have a combobox at the top of the form that asks "who would you like to contact" I need to be able to pass the chosen e-mail to the php script but can't seem to figure it out.

This is what I have so far:

AS2 on form button:
Code: [ Select ]
on (release)
{
    // email '@' verification
  function checkemail(email)
  {
    var _loc2 = new String(email);
    var _loc1 = _loc2.split("@");
    if (_loc1.length != 2 || _loc1[1].indexOf(".") < 1)
    {
      showerror("Invalid email address");
      return (false);
      
    }
    else
    {
      return (true);
    } // end else if
  } // End of the function
    
    // Error message
  function showerror(message)
  {
    gotoAndStop("error");
    error = message;
  } // End of the function
    
    
    // Fields verification
  if (cname != "" && cname != undefined && email != "" && email != undefined && company != "" && company != undefined && msg != "" && msg != undefined && who != "" && who != undefined )
  {
    if (checkemail(email))
         {
            // If all fields are verified; send data
            loadVariables("wasserMail.php", "", "POST");
            
            showerror("Sending data...");

            
            
            
            varSender = new LoadVars();

            
            varSender.cname = cname;
            varSender.email = email;
            varSender.company = company;
            varSender.msg = msg;
            varSender.who2 = who2;
        
            
            varSender.sendAndLoad(url, varSender, "POST");
            varSender.onLoad = function(){
            display.text = this.temp;

            }
        
            //'thank you' message
      error = "Your Message has been sent. A Wasser representative will respond to you shortly. ";

            nextFrame();
                stop();
    } // end if
  }
  else
  {
        //show error message if one of fields is empty !
    showerror("Please fill all the fields");
  } // end else if
}
  1. on (release)
  2. {
  3.     // email '@' verification
  4.   function checkemail(email)
  5.   {
  6.     var _loc2 = new String(email);
  7.     var _loc1 = _loc2.split("@");
  8.     if (_loc1.length != 2 || _loc1[1].indexOf(".") < 1)
  9.     {
  10.       showerror("Invalid email address");
  11.       return (false);
  12.       
  13.     }
  14.     else
  15.     {
  16.       return (true);
  17.     } // end else if
  18.   } // End of the function
  19.     
  20.     // Error message
  21.   function showerror(message)
  22.   {
  23.     gotoAndStop("error");
  24.     error = message;
  25.   } // End of the function
  26.     
  27.     
  28.     // Fields verification
  29.   if (cname != "" && cname != undefined && email != "" && email != undefined && company != "" && company != undefined && msg != "" && msg != undefined && who != "" && who != undefined )
  30.   {
  31.     if (checkemail(email))
  32.          {
  33.             // If all fields are verified; send data
  34.             loadVariables("wasserMail.php", "", "POST");
  35.             
  36.             showerror("Sending data...");
  37.             
  38.             
  39.             
  40.             varSender = new LoadVars();
  41.             
  42.             varSender.cname = cname;
  43.             varSender.email = email;
  44.             varSender.company = company;
  45.             varSender.msg = msg;
  46.             varSender.who2 = who2;
  47.         
  48.             
  49.             varSender.sendAndLoad(url, varSender, "POST");
  50.             varSender.onLoad = function(){
  51.             display.text = this.temp;
  52.             }
  53.         
  54.             //'thank you' message
  55.       error = "Your Message has been sent. A Wasser representative will respond to you shortly. ";
  56.             nextFrame();
  57.                 stop();
  58.     } // end if
  59.   }
  60.   else
  61.   {
  62.         //show error message if one of fields is empty !
  63.     showerror("Please fill all the fields");
  64.   } // end else if
  65. }


AS2 on comboBox:
Code: [ Select ]
on (change) {

  who2 = this.getValue()

}
  1. on (change) {
  2.   who2 = this.getValue()
  3. }


Thanks in advance for any help on this!

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 13 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.