Trouble Sending HTML Form Data

I've been tasked with replicating the following HTML in actionscript for the integration of a flash frontend onto an existing cart system:
HTML Code:
<form name="campaign" method="post" action="https://www.client.net/portal/site/client/template.APPFORM?app=CL_OC">
<input type="hidden" name="campaignSnippet" id="campaignSnippet" value="<campaign trackingCode="testing" xmlns="campaign"><ATONCE><styleColor number="123456-789"/></ATONCE></campaign>"/>
</form>
Now, I've been able to build the value string without any issues, but getting it to post successfully to the server is what's giving me problems. I've been able to use the above code in an HTML page to post the item to the cart successfully, but my code in AS3 (below) isn't successful:
ActionScript Code:
var sendOrder:URLRequest = new URLRequest( "https://www.client.net/portal/site/client/template.APPFORM?app=CL_OC" );
sendOrder.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.type = "hidden";
variables.name = "campaignSnippet";
variables.id = "campaignSnippet";
variables.value = encodeURIComponent(stringBuilder);
sendOrder.data = variables;
sendToURL(sendOrder);
(stringBuilder is the value string from the HTML snippet above)
What am I doing wrong in building the HTTP request?
Thanks in advance for any help you can throw my way!

Try:
var sendOrder:URLRequest = new URLRequest( "https://www.client.net/portal/site/client/template.APPFORM?app=CL_OC" );
sendOrder.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.type = "hidden";
variables.name = "campaignSnippet";
variables.id = "campaignSnippet";
variables.value = encodeURIComponent(stringBuilder);
sendOrder.data = variables;
var loader:URLLoader = new URLLoader();
// loader.addEventListener(Event.COMPLETE, finished);  // optional
loader.load(sendOrder);

Similar Messages

  • How can I change the order of html form data submitted to me via email?

    I am having customers contact me via an html form posted on my website using the "sendtoemail" command. When I receive the data in an e-mail it  is not presented in the order it appears on the web page and I can't seem to find out what dictates the order the data is presented in or how I can change it.
    Anyone have any ideas on how I can make HTML form data elements appear in the order I want?
    Thanks,
    Andy

    Or find a commercial form-to-email script that is compatible with your server's configuration (PHP, ASP, Perl...) and customize it to your needs.
    Formm@ailer PHP from DB Masters
    http://dbmasters.net/index.php?id=4
    FormToEmail.com (free & pro versions available)
    http://formtoemail.com/formtoemail_pro_version.php    
    Tectite
    http://www.tectite.com/formmailpage.php
    Forms to Go from Bebosoft (script generating software)
    http://www.bebosoft.com/products/formstogo/overview/
    Nancy O.

  • Submitting html form data using ajax

    Hi all
    I am new to ajax..
    i want to save my html form data into DB.
    i usually do it in jsp by submiting data throug form action..
    how can this be done using ajax..pls help me in this case.
    thanx in advance

    This forum is about Sun Studio program development tools for C, C++, and Fortran programming.
    You should ask your question in an appropriate Java forum. At the Sun Forums main page, click the "Java" or "Java ES" tab.

  • ActiveX in BradySoft (CodeSoft) - What Class/Method/Object's would I use to send variable form data to BradySoft?

    What Class/Method/Object's would I use to send variable form data to BradySoft? I have a basic label setup in BradySoft and I want to send it variable form data (a serial number) from Labview ActiveX. I have attached Brady's ActiveX programmers guide but can't figure out what to use for this. P.S. I would call Brady or TekLynx tech support about this but they have a strict policy whereas BradySoft supports ActiveX but their tech support doesn't provide programming help with it. I figured I'd try the NI Forums.  

    Aaronb, I presume by publishing an ActiveX programmers manual the BradySoft software installs Active X objects. You may choose to interact with these objects within LabVIEW using Active X controls. The following link will provide a starting point for LabVIEW help topics on Active X communication: Select ActiveX Object Dialog Box
    http://zone.ni.com/reference/en-XX/help/371361F-01/lvdialog/insert_active_x_object/
    Building a Simple Web Browser Using ActiveX (Example of ActiveX arcitecture)
    http://zone.ni.com/devzone/cda/epd/p/id/81 Hope this helps provide a bit of guidance. Cheers!  

  • Convert XML payload to HTML form data in Receiver HTTP Adapter

    Hi,
    I want to make a HTTP request ( Receiver HTTP Adapter ) to a servlet where I need to send the payload in HTML form format ( name=value ). As per the help document:
    A typical HTML form comprises named fields. When transferring a completed form to the server or a CGI program, the data must be transferred in such a way that the CGI script can recognize the fields that make up the form, and which data was entered in which field.
    The plain HTTP adapter constructs this format using a prolog and an epilog
    Has anyone done this before? I looked through all help documents and forums but in vain. I can resort to Java Mapping to do this but I do not want to re-invent the wheel if I can do it easily using HTTP Adapter Configuration. Please help.

    The parameters available in HTTP adapter for message header are:
    HeaderFieldFive     http://sap.com/xi/XI/System/HTTP
    HeaderFieldFour     http://sap.com/xi/XI/System/HTTP
    HeaderFieldOne     http://sap.com/xi/XI/System/HTTP
    HeaderFieldSix     http://sap.com/xi/XI/System/HTTP
    HeaderFieldThree     http://sap.com/xi/XI/System/HTTP
    HeaderFieldTwo     http://sap.com/xi/XI/System/HTTP
    HTTPDest     http://sap.com/xi/XI/System/HTTP
    TargetURL     http://sap.com/xi/XI/System/HTTP
    URLParamFive     http://sap.com/xi/XI/System/HTTP
    URLParamFour     http://sap.com/xi/XI/System/HTTP
    URLParamOne     http://sap.com/xi/XI/System/HTTP
    URLParamSix     http://sap.com/xi/XI/System/HTTP
    URLParamThree     http://sap.com/xi/XI/System/HTTP
    URLParamTwo     http://sap.com/xi/XI/System/HTTP

  • Send.Asp File error does not send html form

    Hi,
    on my site I have a "contact us" page that contains an html form which I would like to be sent to a specific email once the user clicks on "send".
    I'm trying to do so with POST action connected to send.ASP file. but I keep getting this erro:
    CDO.Message.1 error '800401e4'
    Invalid syntax
    /send.asp, line 15
    Here is the Send.ASP code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <%
    Set myMail=CreateObject("CDO.Message")
    myMail.Subject="Message from site"
    myMail.From="[email protected]"
    myMail.To="[email protected]"
    myMail.CreateMHTMLBody "Name: " + Request.Form("Name") + "<br/>tel no: " + Request.Form("Tel_code") + Request.Form("Tel") + "<br/>Cell no: " + Request.Form("Cell_code") + Request.Form("Cell") + "<br/>Email: " + Request.Form("Email") + "<br/>Subject: " + Request.Form("Subject") + "<br/>message: " + Request.Form("Substence")
    myMail.Send
    set myMail=nothing
    %>
    </body>
    </html>
    here is my html form code:
    שם פרטי ומשפחה
    דואר אלקטרוני
    טלפון
    02
    03
    04
    08
    073
    077
    נייד
    052
    054
    057
    נושא
    תוכן ההודעה

    Hi,
    on my site I have a "contact us" page that contains an html form which I would like to be sent to a specific email once the user clicks on "send".
    I'm trying to do so with POST action connected to send.ASP file. but I keep getting this erro:
    CDO.Message.1 error '800401e4'
    Invalid syntax
    /send.asp, line 15
    Here is the Send.ASP code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <%
    Set myMail=CreateObject("CDO.Message")
    myMail.Subject="Message from site"
    myMail.From="[email protected]"
    myMail.To="[email protected]"
    myMail.CreateMHTMLBody "Name: " + Request.Form("Name") + "<br/>tel no: " + Request.Form("Tel_code") + Request.Form("Tel") + "<br/>Cell no: " + Request.Form("Cell_code") + Request.Form("Cell") + "<br/>Email: " + Request.Form("Email") + "<br/>Subject: " + Request.Form("Subject") + "<br/>message: " + Request.Form("Substence")
    myMail.Send
    set myMail=nothing
    %>
    </body>
    </html>
    here is my html form code:
    שם פרטי ומשפחה
    דואר אלקטרוני
    טלפון
    02
    03
    04
    08
    073
    077
    נייד
    052
    054
    057
    נושא
    תוכן ההודעה

  • How to send the form data through mail with pdf format?

    forms 6i
    Hi to all,
    i am developed one master detail form.example is based on the dept number emp details will be displayed.here my requirment is whatever displayed on the form
    the data ,these data send to mail with any format.is it possible? if is possible any one give a proper solution.
    Regards,
    Stevie
    Edited by: 994418 on 6 May, 2013 11:15 PM

    Hello,
    you can create a Report that accepts the search parameters from the Forms mask and generates a PDF. You also have the option to send the report via mail.
    Personally I would generate the report with a tool like as_pdf
    http://technology.amis.nl/2012/04/11/generating-a-pdf-document-with-some-plsql-as_pdf_mini-as_pdf3/
    Then you can send the mail using utl_mail or utl_smtp.
    www.google.com/search?q=site:forums.oracle.com+utl_mail+utl_smtp
    Regards
    Marcus

  • How do i send the form data to another e-mail address?

    I have created several forms that have data that needs to be shared with others directly...  I've tried to change the parameter of the e-mail, however, I get the following warning:
    "This email address must have a verified FormsCentral account prior to using it as the From address. Submission receipts will be sent from [email protected] until the account is validated."
    The recipient does not have an account.  Can they create one without paying anything?

    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    Go to "Manage my account."
    There have been some problems accessing pages on the Apple web site.  If the hyperlink gives you a "We're sorry" message, try again.

  • Disable sending HTML-Form when pressing Enter from Web Transaction

    Hi,
    I have a web transaction and the corresponding HTML Template.
    In the template I have a form with input fields and a submit button.
    <FORM METHOD="post" ACTION="`wgateurl()`">
    <TD><INPUT TYPE="text" NAME="GWA_HEAD-PROFIT_CENTER" VALUE="`GWA_HEAD-PROFIT_CENTER`></TD>
    <TD><INPUT TYPE="submit" NAME="~okcode=APPR" VALUE="`#approve`"></TD>
    </FORM>
    My problem:
    When entering a value in the input fields and pressing enter the form is submitted.
    Is it possible to disable this way of submitting? I wan't only submit when clicking on the submit button.
    Could Javascript be a solution? But I don't want to check if all input fields are filled with onSubmit. Is there another way?
    Thanks for your help!

    Hi Chris,
    your link is not available now.
    Could you please explain how to fix this issue?
    Thanks in advance.
    GB

  • HTML form Date field - what's the best way to capture it on the backend?

    Hi,
    What would be a good way to capture a text field that contains a date string?
    In my app I have a page with several text fields, that are populated by a calendar pop-up. On the server side I can capture them into a java.util.Date object, but Date is dperecated.
    Should I still use Date or is there a better way?
    I intend to use the date as part of an SQL query.
    Thanks.

    The class java.util.Date is not itself deprecated, however several of its methods are.
    For converting string -> date, you should use the class java.text.SimpleDateFormat. That allows you to specify format strings such as MM-dd-yyyy hh:mm:ss for converting date -> string -> date.
    If you are wanting to set day/month/year on the date object directly, instead of the Date methods setDay, setMonth, setYear, you should instead use the java.util.Calender class:
    calendar.set(Calendar.MONTH, 4);
    The calendar can then be converted to a Date object by calling calendar.getTime().
    If you are going to use the date as part of a sql query, I would recommend using a Prepared statement, and the java.sql.Date/java.sql.Timestamp class as well.
    To convert from java.util.Date to java.sql.Date)
    jva.util.Date utilDate = Calendar.getInstance().getTime();
    java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());cheers,
    evnafets

  • Creating dynamic HTML form from XML data in session

    I'm a bit new to servlets, please bear with me if I don't make myself clear.
    currently i have a HttpServlet that extracts a XML document into a jdom Document.
    this is done within the doGet() method as the XML document is in the session object.
    i would like to create a popup window (a JSP or servlet) that can access the same session, convert some of the data in the XML to a submit form that users can put input into, and have the JSP(or maybe servlet) send the form data and the XML back to the original HttpServlet (through the session object).
    i have a few questions on how to make this happen:
    1.how to create a popup window (JSP or servlet) in a servlet, and forward the session data as well?
    2.if the popup window has a submit form that submits some extra data back to the original httpservlet, will the XML document still be retained in the session?
    and any advise on how to go about this problem is highly appreciated!

    Hi,
    This is my first time posting a reply. Hope this helps.
    I am assuming that you are hitting the servlet from a link. This is one way of doing it. You can create a new window using Javascript. like this.
    <script language="javascript">
    var popupWin
    function openWindow(page){
    popupWin=window.open(page,"","width=800,height=600,resizable,scrollbars");
    </script>
    link
    The response of your servlet will be in the new pop-up window.
    2.if the popup window has a submit form that submits
    some extra data back to the original httpservlet,
    will the XML document still be retained in the
    session?The session should be retained as long as you are hitting the same servlet container . You should be able to access the seesion variable in the original servlet if the form in the pop-up window calls the original servlet.
    --mv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Reading html data & uploading a file in single html form using htp package

    Hi
    I have designed a html screen using htp package in which i have few text items and file upload button. I have to validate all forms data like text items and check box elements and upload file to unix. I am using java script for file validations and cgi script to upload file. With this I am able to either read form data or upload file but not both.
    At a time I want to insert a record to database with html form values and upload file to unix with htp package. Please suggest how can I read html form data + uploading a file to unix simultaneously in a single htp procedure.
    Thanks,
    Pradeep

    Have you ever considered using Application Express (APEX)?
    Oracle Application Express (APEX)
    Sounds like you're going the long way around to create a web based application.

  • How to fill out POST HTML forms from my Java Application?

    Hi -
    I am writing a little Java GUI program that will allow a user to fill out data from the GUI and then submit that data. When they submit the data (two text fields) I want to take the two text fields and submit them via the POST form method of a HTML document over the web.
    Here is what I got so far:
    host = new URL("http", "<my_address>", web port, "/query.html");
                InputStream in = host.openStream();
                BufferedInputStream bufIn = new BufferedInputStream(in);
                for (;;)
                    int data = bufIn.read();
                    // Check for end of file
                    if (data == -1)
                        break;
                    else
                        System.out.print ( (char) data);
                }What that code does is makes a URL, opens a stream, and reads the HTML source of the file at the specified URL. There is a form that submits data via the POST method, and I would like to know how to write data to specific forms and specific input types of that form.
    Then, I'd like to be able to read the response I get after submitting the form.
    Is this possible?
    Thanks,

    Here is how one of my e-books go about Posting
    I tryied in one of my projects and it works ok
    (Tricks of the Java Programming Gurus)
    There's another reason you may want to manipulate a URLConnection object directly: You may want to post data to a URL, rather than just fetching a document. Web browsers do this with data from online forms, and your applets might use the same mechanism to return data to the server after giving the user a chance to supply information.
    As of this writing, posting is only supported to HTTP URLs. This interface will likely be enhanced in the future-the HTTP protocol supports two ways of sending data to a URL ("post" and "put"), while FTP, for example, supports only one. Currently, the Java library sidesteps the issue, supporting just one method ("post"). Eventually, some mechanism will be needed to enable applets to exert more control over how URLConnection objects are used for output.
    To prepare a URL for output, you first create the URL object just as you would if you were retrieving a document. Then, after gaining access to the URLConnection object, you indicate that you intend to use the connection for output using the setDoOutput method:
    URL gather = new URL("http://www.foo.com/cgi-bin/gather.cgi");
    URLConnection c = gather.openConnection();
    c.setDoOutput(true); Once you finish the preparation, you can get the output stream for the connection, write your data to it, and you're done:
    DataOutputStream out = new DataOutputStream(c.getOutputStream());
    out.writeBytes("name=Bloggs%2C+Joe+David&favoritecolor=blue");
    out.close();
    //MY COMMENT
    //This part can be improved using the URLEncoder
    //******************************************************You might be wondering why the data in the example looks so ugly. That's a good question, and the answer has to do with the limitation mentioned previously: Using URL objects for output is only supported for the HTTP protocol. To be more accurate, version 1.0 of the Java library really only supports output-mode URL objects for posting forms data using HTTP.
    For mostly historical reasons, HTTP forms data is returned to the server in an encoded format, where spaces are changed to plus signs (+), line delimiters to ampersands (&), and various other "special" characters are changed to three-letter escape sequences. The original data for the previous example, before encoding, was the following:
    name=Bloggs, Joe David
    favoritecolor=blue If you know enough about HTTP that you are curious about the details of what actually gets sent to the HTTP server, here's a transcript of what might be sent to www.foo.com if the example code listed previously were compiled into an application and executed:
    POST /cgi-bin/gather.cgi HTTP/1.0
    User-Agent: Java1.0
    Referer: http://www.foo.com/cgi-bin/gather.cgi
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Content-type: application/x-www-form-urlencoded
    Content-length: 43name=Bloggs%2C+Joe+David&favoritecolor=blue
    Java takes care of building and sending all those protocol headers for you, including the Content-length header, which it calculates automatically. The reason you currently can send only forms data is that the Java library assumes that's all you will want to send. When you use an HTTP URL object for output, the Java library always labels the data you send as encoded form data.
    Once you send the forms data, how do you read the resulting output from the server? The URLConnection class is designed so that you can use an instance for both output and input. It defaults to input-only, and if you turn on output mode without explicitly setting input mode as well, input mode is turned off. If you do both explicitly, however, you can both read and write using a URLConnection:
    c.setDoOutput(true);
    c.setDoInput(true); The only unfortunate thing is that, although URLConnection was designed to make such things possible, version 1.0 of the Java library doesn't support them properly. As of this writing, a bug in the library prevents you from using a single HTTP URLConnection for both input and output.
    //MY COMMENTS
    When you doing URL encoding
    you should not encode it as one string becouse then it will encode the '=' signes and '&' signes also
    you should encode all the field names and values seperatly and then join them using '&'s and '='s
    Ex:-
    public static void addField(StringBuffer sb,String name, String value){
       if (sb.length()>0){
          sb.append("&");
       sb.append(URLEncoder.encode(name,"UTF-8"));
       sb.append("=");
       sb.append(URLEncoder.encode(value,"UTF-8"));
    }

  • Handling form data

    Hi all,
    i will first xplain the situation:
    i have page1 which sends 3 form data like year , date , name
    to page2 , in page2 im getting the form date(from page1) and store
    that data in new variables, In page 2 i have a form there i am
    using three hidden fileds for passing the data from the previous
    page(page1) to the same page because my query changes with the url
    data.Iam getting an error saying month2 is not defined in form, can
    anyone help me out, i appreciate any new ideas.
    Thanks in advance
    here is the code :
    <cfquery name="getWinners1" datasource="FMA_REPORTS" >
    select convert(char,f.monthYear,101)as date
    , r.run_start_date as date ,r.run_name as runname,w.fir_name
    as first,w.last_name as last from fm_run r, wdl_empl w,
    fm_eng_winners f
    where 0=0 and f.empl_id=w.empl_id and r.run_id=f.run_id
    <cfif #runname1# is not " ">
    and r.run_name_ecount= '#runname1#'
    </cfif>
    <cfif #year1# is not "00">
    and datepart(yyyy,f.monthYear)=#year1# </cfif>
    <cfif #month1# is not "00">
    and datepart(mm,f.monthYear)=#month1#</cfif>
    <cfif #orderby1# is not "" >
    and order by #orderby1#</cfif>
    </cfquery>
    the runname , year1, month1 are from page1(i used cfset
    month1=#form.month#>)
    My form:
    <cfform name="Rankings" action="new_ra.cfm" method="post"
    preservedata="no">
    <input type="hidden" value="#runname1#"
    name="runname2">
    <input type="hidden" value="#year1#" name="year2">
    <input type="hidden" value="#month1#" name="month2">
    <cfoutput>
    checking the input fields: value="#runname1#"
    </cfoutput>
    <cfif #getWinners1.RecordCount# NOT EQUAL 0 >
    <table border="=1">
    <tr><td><a href="new_ra.cfm?orderby=run_name"
    onClick="javascript: submitform()">RUN
    NAME</a></td><td><a
    href="new_ra.cfm?orderby=first" onClick="javascript:
    submitform()">FIRST NAME</a></td><td><a
    href="new_ra.cfm?orderby=last" onClick="javascript:
    submitform()"></a> LAST NAME</td><td
    colspan="2"><a
    href="new_ra.cfm?orderby=date">DATE</a></tr>
    <cfoutput query=getWinners1>
    <tr><td>#runname#</td><td>#first#</td><td>#last#</td><td>#date#</td></tr>
    </cfoutput>
    </table>
    </cfform>
    Error message:
    Element MONTH2 is undefined in FORM.
    The error occurred in
    /content/employees/htdocs/emp/operating/tey/fuel_masters/reporting/new_ra.cfm:
    line 3
    1 : <cfif Isdefined("URL.orderby")>
    2 : <cfoutput>
    3 :
    Text
    form month2 value="#Form.month2#"
    4 : form year value= #form.year2#
    5 : orderby =#URL.orderby#</cfoutput>

    It is difficult if not impossible to have url and form
    variables in the same template. It sounds like your page 2 form is
    using method="get". If that's the case, change your scope to url
    for all those form variables.

  • Can a HTML form send data to two servlets?

    I would like to know if an HTML Form can send data to two servlets, I guess I am askin is that can the parameters be passed to two ACTION attributes??

    Hmmmm, well I'm not sure if that is possible, but you could do something of the sort on the server side by chaining them.... the technieque is called Servlet Chaining
    Hope this helps
    Omer

Maybe you are looking for

  • Error in using System Variable

    Dear all,          I want to use System Variable 225 ( VAT percent (per VAT code) ) which is used in one of document i.e. "VAT Only Invoice". When I used it in my Invoice document the following error occurs: Printing Error : Invalid Variable number (

  • Oracle 9.2.0.3.0 patch set for windows - questions

    Hi! I have for that some questions. I have oracle 9.2.0.1.0 on a windows 2003 server running with one local database - no real apllication cluster. I don't understand which instructions I have to make for oracle upgrade? Must I also make the 3. instr

  • SAP R/3

    I'm building a portal with coldfusion and mySQL. I need some data from a SAP R/3 database. The administrator of SAP is willing to export a text file each day with the data that I need so that I can import it into mySQL. I have no problem with this. T

  • After latest updates july 2013 will not open cds

    since my recent updates about 3 days ago, the cds I try to load will not read. Even cds that have been previously put onto itunes will not load. MAC mini spits them out.

  • ADF BC: JBO-33001 Can`t find bc4j.xcfg in classpath

    When i run my application (in JDeveloper 10.1.2.1.0.1913) and execute a "bc4jUtil.getAppMod" it gives me the JBO-33001 exception. The thing is that i changed the directory where my Application Modules, Views, Entities were (because of needs of the pr