Need an example of AS3 to duplicate form

I have been trying to solve this problem for 4 days to no avail. The entire site is done with the exception of this one hangup. I need to have 2 email forms on 2 different places in the timeline going to 2 different addresses. I have the PHP for both, but am having problems getting the 2nd form to function.
When I try to reuse the same code for the 2nd email, I get a load of errors regarding duplicate functions.
Can anybody edit, copy and paste an example of the following script (the one that works with the first form).  I believe can figure out the instance name changes, etc. if I have something to work with.
I am a total newbie and don't know a thing about AS3 and I have a hard time understanding the explanations.  I just need a script that won't conflict with the first form as duplicating functions etc.  Thanks (PS: The string in red is for the 1st email form. I also have a PHP file "send_email_02.php" for the 2nd email form.
stop();
contact_name.text = contact_email.text = contact_subject.text =
contact_message.text = message_status.text = "";
send_button.addEventListener(MouseEvent.CLICK, submit);
reset_button.addEventListener(MouseEvent.CLICK, reset);
var timer:Timer;
var var_load:URLLoader = new URLLoader;
var URL_request:URLRequest = new URLRequest( "send_email.php" );
URL_request.method = URLRequestMethod.POST;
function submit(e:MouseEvent):void
if( contact_name.text == "" || contact_email.text == "" ||
  contact_subject.text == "" || contact_message.text == "" )
  message_status.text = "Please complete all text fields.";
else if( !validate_email(contact_email.text) )
  message_status.text = "Please enter a valid email address.";
else
  message_status.text = "sending...";
  var email_data:String = "name=" + contact_name.text
        + "&email=" + contact_email.text
        + "&subject=" + contact_subject.text
        + "&message=" + contact_message.text;
  var URL_vars:URLVariables = new URLVariables(email_data);
  URL_vars.dataFormat = URLLoaderDataFormat.TEXT;
  URL_request.data = URL_vars;
  var_load.load( URL_request );
  var_load.addEventListener(Event.COMPLETE, receive_response );
function reset(e:MouseEvent):void
contact_name.text = contact_email.text = contact_subject.text =
contact_message.text = message_status.text = "";
function validate_email(s:String):Boolean
var p:RegExp = /(\w|[_.\-])+@((\w|-)+\.)+\w{2,4}+/;
var r:Object = p.exec(s);
if( r == null )
  return false;
return true;
function receive_response(e:Event):void
var loader:URLLoader = URLLoader(e.target);
    var email_status = new URLVariables(loader.data).success;
if( email_status == "yes" )
  message_status.text = "Success! Your message was sent.";
  timer = new Timer(500);
  timer.addEventListener(TimerEvent.TIMER, on_timer);
  timer.start();
else
  message_status.text = "Failed! Your message was not sent.";
function on_timer(te:TimerEvent):void
if( timer.currentCount >= 10 )
  contact_name.text = contact_email.text = contact_subject.text =
  contact_message.text = message_status.text = "";
  timer.removeEventListener(TimerEvent.TIMER, on_timer);

There are several ways to do this. The way that I like best is using a User Setting.
1) Pick a name for your setting.
2) Enter the name of the setting in the web service configuration for the two (or more) web services that want to share the setting. Any portlet that needs to "see" the setting must have it specified its web service configuration.
3) When a user clicks on a link in one of your portlets, set the setting: IPortletResponse.SetSettingValue(SettingType.User, "settingName", "settingValue")
4) In another portlet, get the setting and display it: IPortetRequest.GetSettingValue(SettingType.User, "settingName")
The nice thing about doing it this way is that even if your portlets are set to be cached "forever," they will change whenever you change the user setting (assuming you followed step 2).
Hope this helps,
Chris Bucchere
[email protected]
Bucchere Development Group
http://www.bucchere.com| 415.516.3941

Similar Messages

  • Need to configure output type for adobe form

    Hello All,
    I need to configure output type for Adobe Form thru NACE. What would be print program and how do I call my form from that program? and, what would be the FORM routine for that form in NACE?
    I'm little confused, Pls I need your help.
    Thanks in advance,
    Chandra

    Hi,
    Just before few weeks we did this task.
    Say for example if you want to print PO details through ADOBE form instead of normal sapscript layout or standard MEDRUCK, you can follow the following steps.
    1. Design the form in SFP tcode, by passing the necessary inputs through form interface.
    2. Then use tcode tcode NACE and select EF as application and click output types button on the          application tool bar. Select NEU output type and double click processing routines on left side.
    3. Then, in the right side of the screen we can see the calling program and the form (may be sapscript or smartform) whatever used.
    4. For form names we have two options in NACE tcode.
    One is Form and the otherone is PDF/Smartform Form. If you are using adobe form give your form name under PDF/Smartform and also select PDF under the type option in the same screen.
    This worked perfectly for us. But pass the required parameters to the form from the routine used in standard program.
    If any queries please post it.

  • How can I have a recipient complete duplicate forms?

    I have to send a form to several entities with in my company.  Each entity needs to complete the same form for each of their accounts (ranging from 5-20 accounts per entity). How can i have them duplate the form easily.  I am using Adobe 9 standard.  The form is currently in excel.

    Just have them save it to a new name. It is not clear what you are doing with the form. They can simply be completed and submitted, requiring no saving (only data submitted). What do you mean by duplicate forms as such.

  • Need to find the SID of a forms session.

    Hi,
    I need to find the SID of a form session. How to find the same.
    Eg:- If a user connected to our EBS system, Then automatically one sid will be generated to that user. I need to find the SID for this user. If given detailed steps it would be great help.
    Regards
    SR.

    Hello,
    Although I am a bit unclear about the question. But please see if the following helps;
    I can query the v$session to know about the SID. Here is a simple example;
    select  sid,
    substr(username,1,15) "DB UserName",
    substr(osuser,1,15) "OS UserName",
    substr(command,1,3) CMD,
    substr(machine,1,10) Machine,
    terminal, process, status,
    substr(program,1,50) "OS Program Name"
    from v$session
    where type = 'USER'
    order by usernameHere is a sample output;
                SID DB UserName     OS UserName     CMD MACHINE    TERMINAL         PROCESS      STATUS   OS Program Name
                  7                 SYSTEM          0   ORAAPPPROD ORAAPPPROD       976          ACTIVE   ORACLE.EXE
                  8                 SYSTEM          0   ORAAPPPROD ORAAPPPROD       3548         ACTIVE   ORACLE.EXE
    Additionally you can also review Oracle Metalink Script: How To Identify The apps User Using The O/S PID For Forms Users In 11i Doc ID: Note:185762.1.
    https://metalink.oracle.com/metalink/plsql/f?p=130:14:38346007578631471::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,185762.1,1,1,1,helvetica
    Hope it helps. Maybe others might add in this.
    Adith

  • Need some examples for smartforms and scripts

    hi
    now i am working in scripts and smartforms. so i need some examples and some information for scripts and smartforms. where i can find that information.

    hi jyothsna,
    i have given below a simple example
    this is the report program,
    *& Report  ZSCRIPT1                                                    *
    REPORT  ZSCRIPT1                                .
    TABLES : EKKO,
             EKPO,
             KNA1,
             USR01,
             MARA,
             MAKT.
    DATA : BEGIN OF ZOPTION.
            INCLUDE STRUCTURE ITCPO.
    DATA : END OF ZOPTION.
    PARAMETERS: P_EBELN LIKE EKKO-EBELN,
                P_EBELP LIKE EKPO-EBELP.
    CLEAR EKPO.
    SELECT SINGLE * FROM EKPO
           WHERE EBELN = P_EBELN AND
                 EBELP = P_EBELP.
    CLEAR KNA1.
    SELECT SINGLE NAME1 FROM KNA1
                  INTO KNA1-NAME1
                  WHERE KUNNR = EKPO-KUNNR.
    CLEAR MAKT.
    SELECT SINGLE MAKTX FROM MAKT
                  INTO MAKT-MAKTX
                  WHERE MATNR = EKPO-MATNR AND
                        SPRAS = SY-LANGU.
    CLEAR USR01.
    SELECT SINGLE * FROM USR01 WHERE BNAME = SY-UNAME.
    ZOPTION-TDDEST    = USR01-SPLD.        "Output device (printer)
    ZOPTION-TDIMMED   = 'X'.               "Print immediately
    ZOPTION-TDDELETE  = 'X'.               "Delete after printing
    ZOPTION-TDPROGRAM = 'ZPQRPRNT'.        "Program Name
    CALL FUNCTION 'OPEN_FORM'
         EXPORTING
             APPLICATION        = 'TX'
            ARCHIVE_INDEX      = ' '
            ARCHIVE_PARAMS     = ' '
             DEVICE             = 'PRINTER'
             DIALOG             = ' '
             FORM               = 'ZFORM1'
             LANGUAGE           = SY-LANGU
             OPTIONS            = ZOPTION
         IMPORTING
              LANGUAGE           = SY-LANGU
           EXCEPTIONS
             OTHERS     = 1.
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
             ELEMENT       = 'HEADER'
            FUNCTION      = 'SET'
            TYPE          = 'BODY'
             WINDOW        = 'HEADER'
         EXCEPTIONS
              ELEMENT       = 1.
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
             ELEMENT       = 'MAIN'
            FUNCTION      = 'SET'
            TYPE          = 'BODY'
             WINDOW        = 'MAIN'
         EXCEPTIONS
              ELEMENT       = 1.
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
             ELEMENT       = 'FOOTER'
            FUNCTION      = 'SET'
            TYPE          = 'BODY'
             WINDOW        = 'FOOTER'
         EXCEPTIONS
              ELEMENT       = 1.
    CALL FUNCTION 'CLOSE_FORM'
         EXCEPTIONS
              UNOPENED = 1
              OTHERS   = 2.
    This is the layout Set
    Layout set           Z_TESTSCRIPT
    Description          Test SAP script
    Standard attributes
      First page          FIRST
      Default paragraph   P1
      Tab-stop            1.00 CH
      Page format         DINA4
      Orientation         Landscape
      Lines/inch            6.00
      Characters/inch      10.00
    Font attributes
      Font family         COURIER
      Font size           12.0 Point
      Bold                No
      Italic              No
      Underlined          No
    Characters    Attributes
      B           Character String Bold
                  Standard attributes
                  Marker            No
                  Font attributes
                  Bold              Yes
    Paragraphs    Attributes
      P1          Default Paragraph
                  Standard attributes
                  Line spacing      1.00 LN
                  Left margin       1.00 CM
                  Alignment         Left-aligned
                  Font attributes
                  Font family       TIMES
                  Font size         12.0 Point
      P2          Header Paragraph
                  Standard attributes
                  Line spacing      1.00 LN
                  Left margin       4.50 CM
                  Alignment         Left-aligned
                  Font attributes
                  Font family       TIMES
                  Font size         18.0 Point
                  Bold              Yes
      P3          Undelined paragraph
                  Standard attributes
                  Line spacing      1.00 LN
                  Alignment         Left-aligned
                  Font attributes
                  Font family       TIMES
                  Font size         12.0 Point
                  Underlined        Yes
    Windows       Attributes
      MAIN        Main window
                  Window type       MAIN
      HEADER      Main window
                  Window type       CONSTANT
      FOOTER      Main window
                  Window type       CONSTANT
    Pages         Attributes
      FIRST       First Page
                  Standard attributes
                  Next page         FIRST
                  Page counter
                  Mode              START
                  Numbering type    Arabic numerals
                  Page window
                  HEADER               Left margin          00.00 CM
                                       Upper margin         00.00 CM
                                       Window width         20.00 CM
                                       Window height        04.00 CM
                  MAIN                 Left margin          00.00 CM
                                       Upper margin         05.00 CM
                                       Window width         20.00 CM
                                       Window height        20.00 CM
                  FOOTER               Left margin          00.00 CM
                                       Upper margin         25.00 CM
                                       Window width         20.00 CM
                                       Window height        04.00 CM
    Text elements for following windows:
    HEADER
    Element HEADER
    /: POSITION XORIGIN 2 CM YORIGIN '-0.5 CM'
    /: BOX XPOS 1 CM YPOS 1 CM WIDTH 18 CM HEIGHT 1 CM FRAME 10 TW INTENSITY 10
    P2     ,,<B>TEST PURCHASE ORDER</>
    MAIN
    Element MAIN
    P1  <B>Customer/Supplier:</>,,&KNA1-NAME1&
    P1  <B>PO No:</>,,&EKPO-EBELN&
    P1  <B>Part No:</>,,&MAKT-MATNR&
    P1  <B>Description:</>,,&MAKT-MAKTX&
    P1  <B>Quantity:,,</>&EKPO-MENGE&
    P1  <B>Sign:</>&uline(81)&
    P1  <B>Date:</>&EKKO-AEDAT&
    FOOTER
    Element FOOTER
    /: POSITION XORIGIN 2 CM YORIGIN '-0.5 CM'
    /: BOX XPOS 1 CM YPOS 1 CM WIDTH 18 CM HEIGHT 1 CM FRAME 10 TW INTENSITY 10
    P2     ,,<B>PLEASE SIGN THE PO BEFORE DISPATCH</>
    <b>reward if useful :)</b>

  • My family put multiple devices on the icloud, and I need to know how to manage duplicate entries.  Specifically contacts.  If I fix the contact list on my pc will it push the info out to the other devices and maintain it correctly?

    My family put multiple devices on the icloud, and I need to know how to manage duplicate entries.  Specifically contacts.  If I fix the contact list on my pc will it push the info out to the other devices and maintain it correctly?

    All devices signed into the same iCloud account will finish up with the same contacts. Of course if prior to joining iCloud two family members each had an entry for Uncle Fred, then you will finish up with two contact cards for Uncle Fred, and so on. If you tidy this up on your computer then the changes will propagate to everyone else.

  • I need to align the margins of my forms with those of my website, I have looked at all the options and unfortunately I am unable to do it with access to the Adobe.form.min.CSS file which I can't access as a consumer, how else can I fix my problem

    I need to align the margins of my forms with those of my website, I have looked at all the options and unfortunately I am unable to do it with access to the Adobe.form.min.CSS file which I can't access as a consumer, how else can I fix my problem

    I need to align the margins of my forms with those of my website, I have looked at all the options and unfortunately I am unable to do it with access to the Adobe.form.min.CSS file which I can't access as a consumer, how else can I fix my problem

  • My livecycle designer es4 form needs password protection for parts of the form

    I  have a form created in livecycle designer es4 that will be used by Adobe Reader users in three stages. The first stage is setting up choices on the form, saving them and passwordprotecting this Save. The form will be used three more times, each time saved as a new file.
    How do I password protect each saved version from a command button?

    Greetings,
    You have a couple of options depending on whether you need to display the number when the form is created, or saved.
    You will need a 'Back-end' data store - most likely a database with a table that at a minimum keeps track of the last used number.
    If you are saving the data from the form into a database, you could return the number to the user after saving the data ( and generating the associated number )
    If you are wanting to display the number when the form is first opened, you will need to set up an action profile that fires when the form opens to call the back-end and get the next number.
    There is no guarantee that the user will save this form, so you may end up with gaps in your sequence if you are assigning numbers other than when saving.
    The forum has many posts on loading data into forms before presentation, and also some on using web services to push and pull data from forms.
    Hope this helps
    Mark

  • Need an example for work flow based on multistep activity

    hi,
    i need an example for work flow based on multistep activity for practicing.please do the need.
    thanks

    Hi,
    Workflow document information:
    Check these links.
    http://www.sapgenie.com/workflow/index.htm
    /people/ginger.gatling/blog/2005/12/01/link-workflow-business-objects-to-your-collaboration-tasks
    http://help.sap.com/saphelp_nw04/helpdata/en/92/bc26a6ec2b11d2b4b5006094b9ea0d/content.htm
    http://help.sap.com/saphelp_bw33/helpdata/en/92/bc26a6ec2b11d2b4b5006094b9ea0d/content.htm
    http://help.sap.com/saphelp_bw31/helpdata/en/8d/25f94b454311d189430000e829fbbd/content.htm
    http://www.sap-press.com/product.cfm?account=&product=H950
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    &**********Reward points if helpful**************&

  • Need an example code for IMAP

    Hello friends,
    I need an example of IMAP using Javamail to retieve new mails from an INBOX .Pls send me an example if u have any .Or suggest me the site where i can get an example on it.

    Hi,
    I suggest to look at the demo files in the javamail package.
    I think msgshow.java is a good example.

  • Need some example of  'SET DATE MASK'.

    Hi Gurus,
    I need come example of 'SET DATE MASK ' & 'SET TIME MASK'.
    Thanking you.
    Subash

    Hi Subasha,
    / : SET DATE MASK = 'MMMM DD, YY'
    This displays the date as : September 26, 07.
    YY Year (2 digits)
    YYYY Year (4 Digits)
    MM Month (2 Digits)
    MMM Month Name (Abbreviated)
    MMMM Month Name (Full)
    DD Day as two digits
    DDD Day name (Abbreviated)
    DDDD Day name
    Using the SET DATE MASK causes the subsequent date fields to be displayed using the same formatting. To return to the default formatting use the following command:
    /: SET DATE MASK = ' '
    /: SET TIME MASK = 'HH hrs MM min SS sec'
    This displays the time as : 11 hrs 43 min 37 sec'
    The following are the codes that can be used in the time mask:
    HH Hours
    MM Minutes
    SS Seconds
    The time formatting can be reset to the default setting using:
    /: SET TIME MASK = ' '

  • Duplicate form pane name 'AuctionEventInfo' found in /auction/univ/auctione

    Hi All,
    Please can you help me with below error.
    Message: Facility=local4;sessionid=zFboRvxT7xdROeuXcDH1LdKIz17KcTSGMgE-iA8C_SAP;tenantid=#tenant.wftdev#;username=wft_bpa003;Duplicate form pane name 'AuctionEventInfo' found in /auction/univ/auctionevent.xml
    Category: /Applications/E-Sourcing/eso
    Application: sap.com/E-Sourcing-Server
    Thread: Thread[HTTP Worker [@1339509681],5,Dedicated_Application_Thread]
    Regards
    Mahesh

    Hi Mahesh,
    If i am not worng it says that there is a duplicate file existing in the folder"/Applications/E-Sourcing/eso " please cross check and if you dont want the file please delete the existing file then you would be able to inser the new file successfully...
    Regards,
    Naveen

  • Need JNDI example for THIN CLIENT

    I ned a JNDI example for a thin client (as opposed to a java program connecting on the same machine as the server).
    1> Specifically, I need an example of a JNDI Provider URL
    Would it be <b>corbaloc.iiop:<host>:5004   ???</b>
    2> Also, how do I create a Queue Connection factory from within the GUI (Visual Administrator), so I can find out what to use on the THIN CLIENT Program?
    Thanks

    Hi,
    Please find the answers below.
    > I ned a JNDI example for a thin client (as opposed to
    > a java program connecting on the same machine as the
    > server).
    >
    > 1> Specifically, I need an example of a JNDI Provider
    > URL
    >
    > Would it be <b>corbaloc.iiop:<host>:5004   ???</b>
    Have a look at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/08/8f633e0084e946e10000000a114084/frameset.htm">this</a> link.
    > 2> Also, how do I create a Queue Connection factory
    > from within the GUI (Visual Administrator), so I can
    > find out what to use on the THIN CLIENT Program?
    Have a look at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/26/9b569f525445b0b3d66474b7569d39/frameset.htm">this</a> link.
    > Thanks
    Hope that helps,
    Vladimir

  • I need an example of JSR179 implementation for CDC based device

    Actually i am trying to develop an LBS(Location based Service) application for Pocket PC that is a CDC based Device,
    I searched a lot on internet for any example that could help me but could't found anything usefull information.
    I found a lot of stuff for MIDP, i found JSR179 implementation for MIDP but could't found anything for CDC(Connected Device Configuration).
    So i need an example of JSR179 implementation for CDC based device. I really need it.
    waiting for your help....
    thanx
    Vivek Mishra

    What is it from a business perspective that you are trying to accomplish?
    What are you going to do with this data once you get it into the format you're envisioning?
    Are you anticipating creating a collection of REC_SET records? Is there a reason that you're not using an associative array keyed on the c2 value (assuming collections are even appropriate to the problem you're trying to solve)?
    Justin

  • HT4623 My iphone 3gs has downloaded to the ios6 and it keep shutting down i need to reset it back to its former 3gs setting how do i do this

    My iphone 3gs has downloaded to the ios6 and it keep shutting down i need to reset it back to its former 3gs setting how do i do this

    USB connection to iTunes. Back up your 3GS with your last 3GS back up. DON'T use an iPhone 4 back up or higher. It will cause exactly this.

Maybe you are looking for