5 Replies Latest reply on Dec 8, 2009 9:44 AM by Ned Murphy

    Radio Button/Input Form Problem

    yeti juniot

      Hi folks,
      I have created a form which sends the inputted values as an email. The file takes a name, delivery address etc and also should allow a quantity to be input. There is also an option where a different delivery address can be specified like so:
      http://i50.tinypic.com/2cih851.jpg
      The code looks okay, with no compiling errors, but the 'user input quantity' does not work and when changing different address, the original invoice address is showing up
      Any help or pointers would be gratefully appreciated
      My code looks like this:

      stop();
      // The display function
      System.useCodepage = true;
      send_btn.onRelease = function() {
           my_vars = new LoadVars();
           my_vars.designName = designName.text;
           my_vars.designPosition = designPosition.text;
           my_vars.designAddress = designAddress.text;
           my_vars.designTel = designTel.text;
           my_vars.designFax = designFax.text;
           my_vars.designMob = designMob.text;
           my_vars.designEmail = designEmail.text;
           my_vars.invoiceName = invoiceName.text;
           my_vars.invoicePosition = invoicePosition.text;
           my_vars.invoiceAddress = invoiceAddress.text;
           my_vars.invoiceTel = invoiceTel.text;
           my_vars.invoiceFax = invoiceFax.text;
           my_vars.invoiceEmail = invoiceEmail.text;
           my_vars.invoiceDate = invoiceDate.text;
           my_vars.jobNumber = jobNumber.text;
           if ("same" eq delivery.getValue) {
                my_vars.deliveryName = invoiceName.text;
                my_vars.deliveryPosition = invoicePosition.text;
                my_vars.deliveryAddress = invoiceAddress.text;
                my_vars.deliveryTel = invoiceTel.text;
                my_vars.deliveryFax = invoiceFax.text;
                my_vars.deliveryEmail = invoiceEmail.text;
           } else  {
                my_vars.deliveryName = deliveryName.text;
                my_vars.deliveryPosition = deliveryPosition.text;
                my_vars.deliveryAddress = deliveryAddress.text;
                my_vars.deliveryTel = deliveryTel.text;
                my_vars.deliveryFax = deliveryFax.text;
                my_vars.deliveryEmail = deliveryEmail.text;
           }
           if ("other" eq quantity.getValue) {
                my_vars.quantity = quantityOther.text;
           } else {
                my_vars.quantity = quantity.getValue();
           }
           if (my_vars.designName != "" and my_vars.designPosition != "" and my_vars.designAddress != "" and my_vars.designTel != "" and my_vars.designFax != "" and my_vars.designMob != "" and my_vars.designEmail != "" and my_vars.invoiceName != "" and my_vars.invoicePosition != "" and my_vars.invoiceAddress != "" and my_vars.invoiceTel != "" and my_vars.invoiceFax != "" and my_vars.invoiceEmail != "" and my_vars.invoiceDate != "" and my_vars.jobNumber != "" and my_vars.deliveryName != "" and my_vars.deliveryPosition != "" and my_vars.deliveryAddress != "" and my_vars.deliveryTel != "" and my_vars.deliveryFax != "" and my_vars.deliveryEmail != "" and my_vars.quantity != "") {
                my_vars.sendAndLoad("mailer.php", my_vars, "POST");
                gotoAndStop(2);
           } else {
                error_clip.gotoAndPlay(2);
           }
           my_vars.onLoad = function() {
                gotoAndStop(3);
           };
      };
      name1.onSetFocus = Position.onSetFocus = address.onSetFocus = telephone.onSetFocus=fax.onSetFocus=Mob.onSetFocus = email.onSetFocus = invoiceName.onSetFocus = invoicePosition.onSetFocus=invoiceAddress.onSetFocus =  invoiceTel.onSetFocus = invoiceFax.onSetFocus = invoiceEmail.onSetFocus = invoiceDate.onSetFocus = jobNumber.onSetFocus = quantity.onSetFocus=function () {
           if (error_clip._currentframe != 1) {
                error_clip.gotoAndPlay(6);
           }
      };
      
      Many thanks !