Using jQuery to Submit a Form to a Method in a CFC

Is this possible? If so, how to you pass in the arguments?
Something like this does not work:

Below is the exact code I am using in production. The
RemoteAccountService.cfc is a remote proxy generated by ColdSpring.
The updateAccessLevel method will either promote or demote the
username depending on the direction parameter. The remote proxy has
some code to return the result of the method, or the exception that
is thrown, in JSON so we parse that out and pull out the error
message and detail. getALInfo() updates the page with the new data.

Similar Messages

  • Using CFHTTP to submit a form directly to a google docs form

    Ok so here is some background
    Google has a service where you can create forms using google docs and embed them into your webpage, Results are automatically stored in a google spreadsheet upon submission.
    I want to use my own form to submit to to the google form processing page which I can get to work however the default generic google hosted thank you page appears upon submissing.
    I know you can use cfhttp to submit a form from a coldfusion server so I was thinking that I could simply pass my form variables to a action page that resubmitted them via cfhttp and thus bypass the thank you page altogether
    however when I try this it does not work and the results do not show up in the google spreadsheet. I figured that mabye the google processing page could tell that it was not submitted from a browser so I tired adding a useragent string but still no luck.
    Here is the code I was trying to use
    <cfhttp method="POST" url="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" redirect="yes" useragent="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)">
         <cfhttpparam type="Formfield" name="entry.0.single" value="testValue1" >
         <cfhttpparam type="Formfield" name="entry.1.single" value="testValue2" >
    </cfhttp>
    And the online spread sheet can be viewed here
    http://spreadsheets.google.com/pub?key=tlo4FjygqMuUGmvuOb2_Gjw&single=true&gid=0 &output=html
    Does anyone know why this is not working?
    To recap I am able to use the following form on my own comptuer to directly submit to the processing page and this works
    <form action="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" method="POST">
    <input type="text" name="entry.0.single" value="" >
    <input type="text" name="entry.1.single" value="">
    <input type="submit" name="submit" value="Submit">
    </form>
    Any help would be greatly appreciated

    YES!!!!!!!!!!!!!!!!!!!!!! This did it final code is as follows thanks for you help
    <cfhttp method="POST" url="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" useragent="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)">
         <cfhttpparam type="Formfield" name="entry.0.single" value="final test">
         <cfhttpparam type="Formfield" name="entry.1.single" value="final test">
          <cfhttpparam type="Formfield" name="submit" value="Submit">
    </cfhttp>
    Man this is great! and has eliminated half my database requirements! now only if you could pull the results back out!

  • Problem using javascript to submit jsf form, values not submitted

    Greetings!
    I have a t:selectOneMenu where I want the page to be submitted when they change the selected value. At this point, I am able to get the form to submit and reload the page, which is all fine. The problem is that none of the values from the page are not set in the backing bean. I have break points on the setter methods that are not being hit.
    I have tried a number of things from searching multiple forums, but here are snippets from my latest version...
    <h:form>
    <t:commandLink id="hiddenLink" forceId="true" value="test link"
    action="#{pc_PageX.doBtnHiddenLinkAction}"></t:commandLink>
    <t:selectOneMenu id="pageList_top" forceId="true" value="#{pc_PageX.ValueX}"
         onchange="jspellSync(); submitPageX();">
         <f:selectItems value="#{pc_PageX.ListX}" />
    </t:selectOneMenu>
    </h:form>
    function submitPageX(){
         var hiddenLink = document.getElementById("hiddenLink");
         hiddenLink.click();
    }Note that the <t:commandLink> is not hidden, though it will be in the final version if I can get this to work.
    If I click the commandLink myself, the page is submitted with all the page values as expected. If I change the list value, thus using javascript to fire the commandLink's click event, the page is submitted with NO values.
    Can anyone come up with an explanation for this behavior? Or better yet, a solution?
    A couple other things I've tried...
    - Not using a commandLink and using jsf's submit function -> onchange="jspellSync(); submit();"
    - Clicking the link using other ways -> hiddenLink.fireEvent('onclick');
    If all else fails, I'll just add a button that they have to click to submit the form.

    snotmare wrote:
    BalusC wrote:
    I recall this problem in one of the ancient JSF versions. Which JSF version do you use? Do you have any room to upgrade to latest? We're using an IBM implementation of JSF, which is at version 7.0. The IBM implementation appears to be built on the JSF base 1.1.That's not an IBM JSF implementation, they do not have any one, they just have some component libraries which runs on top of some JSF implementation. RAD/WSAD ships by default with Sun JSF RI. Try upgrading to at least 1.1_02 which you can download from the aforementioned link. There's a gap of 2 years (and inherently a lot of bugfixes) compared to 1.1. If the application server used supports Servlet 2.5, you could even upgrade to the latest 1.2.
    We've had other issues with the IBM implementation, which could be the cause in this case too. We've been talking about switching to MyFaces, but there is one feature of the IBM version that we like. It's basically a script collector (hx:scriptCollector) that allows us to do pre-processing on the page.As said before, IBM does not have a JSF implementation. So replacing RI by MyFaces wouldn't make any difference.

  • [SOLVED] Using wget to submit a form

    Edit: Figured out I was using the wrong URL and needed some necessary POST/GET data I wasn't filling out.
    Hm, I am trying to be able to submit a form using wget. I am able to actually put data in <textarea> like I want, but I fail to submit it through wget.
    I was able to login to the site by cheating a little bit. I came up with two methods to do it, the first one is easy which is just going to ~/.mozilla/firefox/<xxxx>/cookies.sqlite, and converting it to a *.txt. Easy. Or you can do it the slightly more complicated way by going to page you want, typing the url bar javascript:document.write(document.cookie); document.close(); and manually create the cookies.txt file using the information from that. Anyhow, that is how I am able to go into the site without having to submit my username/password in the first place (I kept failing to do that, it didn't even return the page with my username and password typed in like what's going on below). Anyhow, now I am stumped at actually submitting the post I want to. I execute:
    wget --cookies=on --keep-session-cookies --load-cookies=cookie.txt --post-data="Post=test" http://www.url-to-the-site.com/
    and the end result is:
    ^This is what wget returns and what it looks like when I open it in Firefox.^
    Which is what it returns. I checked the website and it didn't post it (I expected that since it returns that and not the post itself). I know you can't see it in the image there, but there is a submit button at the bottom of the page.
    The form looks something like this (stripped down):
    <form action='<url of website>' method='post' name='REPLIER' onsubmit='return ValidateForm()'>
    <input type='hidden' name='act' value='Post' />
    <input type='hidden' name='s' value='xxxxxx' />
    <input type='hidden' name='f' value='24' />
    <input type='hidden' name='auth_key' value='xxxxxx' />
    <input type='hidden' name='CODE' value='09' />
    <input type='hidden' name='t' value='41457' />
    <input type='hidden' name='p' value='514135' />
    <input type='hidden' name='st' value='0' /><br />
    <input type="submit" name="submit" value="Add Reply" tabindex='4' class='forminput' accesskey='s' />
    <input type="submit" name="preview" value="Preview Post" tabindex='5' class='forminput' />
    </form>
    Any idea?
    **Meh, in my experience of posting here, helpers/answers/whatever usually like an answer of why I have to do this the difficult way instead of just going there and posting myself in the first place (after all, it might help you answer the question). Well, we are playing a little game in there and I wrote a little script that keeps track of the points in the game... It makes a nice little pretty table that I use cron to update every hour, but then people have to wait until I actually post the table to see how they are doing in the game. So... I'd like to have it automatically post each update.
    Then I have a second use: If I am able to successfully post this, I am trying to get into a class at college. I already wrote a script that detects whether there is available space or not in the class. I'd like to be able to have it monitoring for an open spot in the class and if so... to check it [x] and submit so I can get in the class without having to sit at the computer refreshing all day hopelessly.
    And plus I learned programming, how to use so much utilities to do whatever... why stop now?
    In advance, thank you for taking the time to help me with this.
    Last edited by Aprz (2009-12-05 11:25:51)

    have you considered using curl? Submitting forms in curl is very easy. and saving cookies is easy as well.
    for example:
    curl -s -D lccookie -d "login=$login&password=$password" http://somepage.com/index.php?
    to log in (which also is submitting a form), and
    curl -s -b lccookie -e http://somepage.com/index.php --data-urlencode "EntryEffect%3A=$entryeffect" --data-urlencode "ClosingEffect%3A=$closingeffect" --data-urlencode "Color%3A=$colour" --data-urlencode "messagefield=$OPTARG" -d "Submit=Submit" http://somepage.com/index.php?
    to reuse the cookie and submit a form. (This is from a script I wrote that sends formated messages to a page which shows them on a ledbar.)
    Last edited by Shapeshifter (2009-12-03 14:09:36)

  • Using JavaScript to submit a form with multiple submit buttons

    I am a newbie to JavaScript, so hopefully someone can answer
    this for me.
    On my user registration form, I have two buttons that submit
    the form, 'check_availability' (to check if the username is
    available) and 'register'. In my PHP script, I check which button
    was pushed by checking which POST value is set,
    $_POST['check_availability'] or $_POST['register'].
    If I set the 'register' button to a JavaScript function that
    validates the form and then submits it, how do I get my PHP script
    to think 'register' was pushed?

    Sorry I used my old captcha script there.
    [php]
    <?
    session_start();
    if(isset($_POST['button_name'])){
    //DO SOMETHING HERE
    } else {
    //Add the page data
    ?>
    [/php]
    "east99" <[email protected]> wrote in
    message
    news:fepqr8$2mr$[email protected]..
    > Firstly name your buttons then use this script:
    >
    > [php]
    > <?
    > session_start();
    > if(isset($_POST['button_name'])){
    > if ($_POST['vercode'] != $_SESSION['vercode'] OR
    $_SESSION['vercode']=='')
    > {
    > // echo '<strong>Error
    Message</strong><br>';
    > $error = '<strong><font
    color="#FF0000">Error
    > Message</font></strong><br>';
    > } else {
    >
    > //Add the page data
    >
    > }
    > ?>
    > [/php]
    >
    >
    >
    > "AngryCloud" <[email protected]> wrote
    in message
    > news:fecu6r$cl5$[email protected]..
    >>I am a newbie to JavaScript, so hopefully someone can
    answer this for me.
    >>
    >> On my user registration form, I have two buttons
    that submit the form,
    >> 'check_availability' (to check if the username is
    available) and
    >> 'register'. In
    >> my PHP script, I check which button was pushed by
    checking which POST
    >> value is
    >> set, $_POST['check_availability'] or
    $_POST['register'].
    >>
    >> If I set the 'register' button to a JavaScript
    function that validates
    >> the
    >> form and then submits it, how do I get my PHP script
    to think 'register'
    >> was
    >> pushed?
    >>
    >
    >

  • IFrame in jQuery Dialog - submit iFrame using dialog button

    Hi Everyone,
    I know a lot of us are using JQuery modal dialog feature and some of us using iframe strategy to display form or page inside of modal dialog popup. Personally, I am using these features a lot in my app but there is a step where I am a bit stuck.
    Here is my situation ( I am sure most of us will be interested in this to be resolved if not yet):
    I have a regular page (will call it parent page), on this page I have a button and by clicking on this button I am getting a jquery modal window popup. The button itself is pointed to url: javascript:LinkAssets(); and the script to call modal popup with iFrame in HTML Header of parent page is:
    <script type="text/javascript">
    // Link Assets - Modal PopUp
        function LinkAssets(){
    var apexSession = $v('pInstance');
    var apexAppId = $v('pFlowId');
    var assetNumber = $v('P17_ORDER_ID');
    $(function(){vRuleBox = '<div id="LinkAssetsBox" title="Link Assets to the Order">
       <iframe src="f?p='+apexAppId+':55:'+apexSession+'::NO:55:P55_ORDER_NUMBER:'+assetNumber+'"
         width="680" height="320" title="Link Assets to the Order" frameborder="no">
       </iframe>
       </div>'
    $(document.body).append(vRuleBox);
    $("#LinkAssetsBox").dialog({buttons:{"Close":function(){$(this).dialog("close");}},
                                                                   stack:true,
                                                                   modal:true,
                                                                   width:700,
                                                                   height:340,
                                                                   resizable:true,
                                                                   autoResize:true,
                                                                   draggable:true,
                        close: function(){$("#LinkAssetsBox").remove();
                                                             location.reload(true);}
    </script> As you see I am calling page 55 from jquery script into iFarme which will be displayed in modal dialog. All described above is working fine, no problems and most of us use it.
    My problem is here: my JQuery modal dialog has a "CLOSE" button which allows me to close a modal dialog without any changes and go back to my parent page - which is normal behavior. In my iFarme page (page 55) i have an "apply changes" button, and this button calls a process on page 55 by submitting a value and than it closes the modal dialog. "APPLY Changes" button has pointed to the url: javascript:UpdateRecord(); and page 55 has a script in HTML Header to submit value and close modal dialog:
    <script type="text/javascript">
    // -- Function to apply changes and close Modal Dialog--
    function closePopup(){     
       $(function(){parent.$('*').dialog('close');});}
    function UpdateRecord(){doSubmit('APPLY_CHANGES');closePopup();}
    </script> So, what I want is not to have this "Apply Changes" button in my page 55 which is iFrame page, I want this button to be next to my jQuery modal dialog "CLOSE" button which means I have to change my modal dialog popup script to include "APPLY CHANGES" button where this button will submit value to iFrame page and close my dialog.
    I hope whatever is above is readable and understandable.
    Thanks

    since my previous solution didn't work I did try another way. I did try to create a hidden item in my iFrame page -> pass a values "APPLY_CHANGES" to this item from my "ADD" button in parent dialog window and make my DML process in my iFrame (page 55) to fire conditionally when hidden item in iFrame page has "APPLY_CHANGES" value. So, I did change my dialog window script with iframe again to include this:
    $(document.body).append(vRuleBox);
              $("#LinkAssetsBox").dialog({
                            buttons:{"Close":function(){$(this).dialog("close");}
    //from here ---------------
    ,Add:function(){location.href="f?p=&APP_ID.:55:&SESSION.::NO:55:P55_CREATE_REQUEST:APPLY_CHANGES"}
    //to here -----------------
    },               stack: true,
                   modal: true,                         
                            width: 950,
    ...and again....it passes the "APPLY_CHANGES" value to my iFrame page item ( i can see that in session view) but my process is not running or may be it is not getting values of my form items in iFrame page.
    Any ideas...comments on this???

  • Submit data using Jquery/Javascript during button click

    submit data using Jquery/Javascript during button click

    Hi,
    From your description, my understanding is that you want to restrict edit form with jQuery/JS.
    If you want to restrict the default edit form with jQuery/JS, you could refer to these steps below:
    Enter your editform.aspx.
    Add below code under <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">.
    Save this file.
    <script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    function PreSaveAction(){
    if($("select[id$='DropDownChoice']").val()==""){
    alert("please choose a value!");
    return false;
    return true;
    </script>
    The screenshot below is my result(it will not save data after clicking OK in the message alert):
    If you customize your list with InfoPath, you could check the checkbox “Cannot be blank” under Validation section or add a rule for your validation as the screenshot below:
    In addition, you could check your code with pressing F12 to debug your code.
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Manually submit a form without using javascript?

    i'm trying to automate registration of a site by using java (no gui). However there is no direct submit button or form.submit() present in its registration url. Checked the javascript codes and it opens a window, and checks if the window opener is present .
    if (window.opener && !window.opener.closed)
    window.opener.document.theForm.submit();
    window.close();               
    }Is there a solution for this problem?

    I'm trying to access an http url (not mine).
    (1) By setting post variables , I can retrieve the html of the url as string. Here's the code.
         static String getHtml(String url_nm, HashMap variables)
              String html = "";
              String data = "";
              boolean firstRun = true;
              if (variables != null)
                   Set keys = variables.keySet();
                   Iterator iterator = keys.iterator();
                   while (iterator.hasNext())
                        if (firstRun)
                             firstRun = false;
                        else
                             data += "&";
                        String name = iterator.next().toString();
                        try
                             data += URLEncoder.encode(name, "UTF-8") + "=" +
                                  URLEncoder.encode(variables.get(name).toString(), "UTF-8");
                        catch (Exception e1)
              try {
                 URL url = new URL(url_nm);
                 URLConnection conn = url.openConnection();
                 conn.setDoOutput(true);
                 OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
                 wr.write(data);
                 wr.flush();
                 BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                 String line;
                 while ((line = rd.readLine()) != null) {
                      html += line;
                 wr.close();
                 rd.close();
             } catch (Exception e) {
                  e.printStackTrace();
              return html;
    [/code
    (2) The problem is even if i set the post variables, i cannot submit the form since the form can only be submitted if i was actually browsing it in a web browser. The html displays a window where the actual submit  form is set (as you can see in my later post) .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How do I submit a form to a LC process using the process fields component in LC Designer

    I have a PDF Form with the Process Fields component attached.<br /><br />In the FSSubmit component, I have set the URL to <br />http://localhost:8080/soap/services/SAPS_Submission?wsdl, <br />where SAPS_Submission is the name of my process.<br /><br />I open the form through a Flex app, fill out the form and press submit, but get the following error:<br /><br />  <?xml version="1.0" encoding="utf-8" ?> <br />- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><br />- <soapenv:Body><br />- <soapenv:Fault><br />  <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode> <br />  <faultstring>no SOAPAction header!</faultstring> <br />- <detail><br />  <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">dtross</ns2:hostname> <br />  </detail><br />  </soapenv:Fault><br />  </soapenv:Body><br />  </soapenv:Envelope><br /><br />The LC process has the schema for the form as an input variable, which is used in the execution of a insertSQLStatement.<br /><br />My knowledge of the process fields component is sketchy at best, but from what I understand, I can use it to submit to workbench without using a servlet?<br /><br />Any help with getting the data from the form to the process using this technique, or clarification about what I should actually be doing would be greatly appreciated...<br /><br />Thanks<br /><br />Ross Malan

    The process fields are ONLY needed if you're planning to use the form offline or through email. If you submit the data back to a servlet, you just need to put a submit button on the form.
    Jasmin

  • Using Enter key to submit a form, Attn: Didier

    Hi,
    I have an ADF form on my page and want to use Enter key to submit the form. I submit the form using a CommandLink which has a method bound to it as its action in a managed bean. I have set submitCL as the Id of this CommandLink and has set this in my form:
    <af:form defaultCommand="submitCL">
    but the Enter does not work. I'm using IE 7.0 and JDeveloper 10.1.3.2.
    Thanks in advance,
    S/\EE|)

    Hi Saeed,
    not sure if this is related or not, but I would test it with another browser as IE is not supported. See http://www.oracle.com/technology/products/jdev/htdocs/10.1.3.3/install.html#browsers
    Also, when the command button is in the header facet of a table or treeTable, the value of defaultCommand must also contain the table or treeTable ID.
    For example: <af:form defaultCommand="theTreeTableId:submitCL" ...>Regards,
    Didier.

  • Apex.submit issue when using jQuery Overlay

    Dear All,
    This is my first post in this forum and I hope I can find a solution for my issue.
    Currently we are developing a new Time Attendance System by Apex.
    I am facing a problem when I use the jQuery Overlay in one of the pages.
    the page it self is working fine and all it button and tabs are also working fine until I click the link for the overlay content
    the content is another page getting loaded in a similer to a popup window (overlay effect) after I close this overlay window
    all the links in the original page that are using the apex.submit are not working and show an error in the browser "Object doesn't support this method or property"
    This only occur when I click the overlay link but if I load the page and I don't open the overlay link all links are working fine.
    And Thank you all inadvance.
    Regards

    It's always easier to debug an issue like this by recreating the problem on apex.oracle.com and providing credentials.
    How did you set up the overlay content? Did you create any additional HTML elements within one of the apex regions? If was just adding some DIV content then try moving that DIV content to after the #FORM_CLOSE# substitution string in the page template.

  • I need to be able to give them a total price calculation when they submit the form. even if im not using credit card as my only payment option.

    i have an online menu - many of my customers pay by check, cash and credit card as well - is there not an option to show those options...  and items vary in price, i need to be able to give them a total price calculation when they submit the form.

    a) No, b)Yes. Firstly, the only payment gateway currently supported from FormsCentral is PayPal. If your customers complete the FormsCentral Form and order 6 of item 1 at one dollar each and 3 of item 2 at two dollars each, when they press 'Continue to Checkout' button, they are transferred to the PayPal Gateway - which will show the Total to Pay. That's no help for your folks wanting to pay by check. Think you may need another solution. Acrobat won't link directly to a Payment Gateway either, without you doing a bit of JavaScript etc.

  • How to submit two forms at same time?

    Have a client that requires their members to update their profile information and some of the details from that form need to also populate a WebApp.
    I've seeded the CRM with basic (first name, last name, email address, Your ID, and EntityID) member data.
    Members would log in and be asked to update their profile. [action="/MemberProcess.aspx"]
    This submission should update their CRM record *AND* create a WepApp record at the same time.
    I tried the AJAX + jQuery method, including the second WebApp form [action="/CustomContentProcess.aspx?...] fields as type="hidden", and using {tag_FIELD NAME}; but this isn't working for me, I'm admittedly not a real programmer.
    Any thoughts? Thank you very much, in advance for any and all help!
    p.s. the reason for wanting to do this, is so that members do not have to update their CRM profile and then also input their data specific to the WebApp form (it's a member listing) as a separate task.
    p.p.s. after I get through the above hurdle... how can I ensure that a CRM user has one and only one WebApp item (their listing) and that they can edit it? Another issue I'm having now is that users create a new listing in the WebApp if they submit another record and in the future I fear that simply editing their CRM profile will create new WebApp listings too. This site is like a phone book, there should only be one listing for each unique email address (in this case).
    -Will

    You can use Jquery + AJAX to submit as many forms as you want to as many places as you want. Don't use the HTML to submit and have a second javascript submitter as the Javascript might not have time to complete before the page is submitted.
    I wrote this quickly just now, this wont work on the JSfiddle site because you can't form POST / GET anything on it (AJAX included it seems). it will submit to other URLs the same data. It is done in parallel and because we don't know which one will finish quicker, both calls check if all calls are complete before confirming everything is complete. I have not tested it but it would get you 99% of the way there.
    <form id="signup_register" action="" method="post">
        Firstname<br/><input type="text" name="firstname"><br/>
        Lastname<br/><input type="text" name="lastname"><br/>
        <button onclick="formsubmit(this);">Save</button>
    </form>
    <script>
        var url1='http://google.com';
        var url2='http://gmail.com';
        var complete1=false;
        var complete2=false;
        FinishedTwoFormSubmits=function(){
            alert('Finished submit - redirect or whatever you need to do.');   
        formsubmit=function(el){
            var data = $('form#signup_register').serializeArray();
            PostSubmit(url1,data, function(){ complete1=true; if (complete1 && complete2){ FinishedTwoFormSubmits() } });
            PostSubmit(url2,data, function(){ complete2=true; if (complete1 && complete2){ FinishedTwoFormSubmits() } });
        PostSubmit=function(url,data,cb){
              var ret=false;
            var noerror=false;
                        $.ajax({
                                    type: 'POST',
                                    url: url,
                                    cache: false,
                                    data: data
                                  }).done(function(msg) {
                                            try{ noerror=true; }
                                            catch(e){ alert(e+'\n\n'+msg); }
                                            if (noerror){ cb() }
                        return ret;
    </script>

  • Using jquery to upload files

    Hi
    I have uploaded files before but not using jquery but now am trying to use jquery so that my files uploads without page refreshing.
    This is my Jquery code. and below is the html code. Can any one help me with the jquery code so that I can get the data to the php script that process
    the variables.
    JQUERY:
    <script type="text/javascript">
    $(document).ready(function() {
       $("#photoform").submit(function() {
                                var phototitle = $("phototitle").val();
                                var photogenre = $("photogenre").val();
                                var photodesc = $("photodesc").val();
                                var photofield = $("photofield").val();
        $.post("Uploadfix.php", { phototitle: phototitle,
         photogenre: photogenre, photodesc: photodesc, photofield: photofield}, function(data) {
         $("#allresult").html(data);
       return false;
    //-->
    </script>
    PHP CODE:
    $phototitle=addslashes(strip_tags($_POST['phototitle']));
    $photogenre=addslashes(strip_tags($_POST['photogenre']));
    $photodesc=addslashes(strip_tags($_POST['photodesc']));
    $photo=$_FILES["photofield"]["name"];
    $type=$_FILES["photofield"]["type"];
    $size=$_FILES["photofield"]["size"];
    $temp_name=$_FILES["photofield"]["tmp_name"];
    $error=$_FILES["photofield"]["error"];
    echo "$phototitle";
    echo "<br/>";
    echo "$photo";
    echo "<br/>";
    echo "$type";
    echo "<br/>";
    html:
    <form id="photoform" method="post" enctype="multipart/form-data" action=''>
    //id variables:
    </form>
    How can I read in the file from jquery to the php sucessfully. NO SUCESS YET!
    Thanks.

    Hi Gramps
    Thank for the reply. If I use form action like the code below it works but I can not do validation.
    <script type="text/javascript" >
    /* $(document).ready(function() {
                $("#photoform").submit(function(e)         {
                $("#allresult").html('');
                $("#allresult").html('<img src="PHOTOTEST/loader.gif" alt="Uploading...."/>');
                $("#photoform").ajaxForm({
                            target: '#allresult'
            }).submit();
    </script>
    HTML:
    <form id='photoform' enctype='multipart/form-data' method='post' action='process.php'>
    </form>
    PHP:
    $example=$_POST['INPUT'];
    if($example>5)
    echo "input greater than 5 sorry.";
    else
    //process data
    The problem is this is echoed in a new page which is process.php. Instead of on a div on the page that is submitting the form. I know this is
    because of the form action. how can I make the validation appear on a div on same page?
    cheers.

  • How to use jquery.hotkeys.js in ADF application

    Hello all,
    I am developing an ADF application where i am trying to use jquery.hotkeys.js file. I have created a folder js inside ViewController\Web Content\js and i have added jquery.hotkeys.js file inside that folder.
    Now i have created a jspx page and inside that i have 3 input text and 1 submit button now I am trying to use keyboard shortcuts say ALT+F8 to clear the form fields. Here is my full jspx form
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:inputText label="First Name" id="it1" value="#{MyBean2.firstName}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:inputText>
    <af:inputText label="Last Name" id="it2" value="#{MyBean2.lastName}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:inputText>
    <af:inputText label="EmailID" id="it3" value="#{MyBean2.emailId}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:inputText>
    <af:commandButton text="Submit" id="cb1"
    action="#{MyBean2.callSubmit}"
    binding="#{MyBean2.cb1}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:commandButton>
    </af:form>
    <f:facet name="metaContainer">
    <af:resource type="javascript" source="/js/jquery.hotkeys.js"/>
    <af:resource type="javascript">
    function clearAll() {
    $("*").bind('keydown', 'Alt+F8', function (evt) {
    clearForm();
    evt.stopPropagation();
    return false;
    function clearForm() {
    alert('3');
    curElm = document.activeElement;
    var frm = $(curElm).closest('form');
    var frmname = ($(frm).attr('name'));
    document.forms[frmname].reset();
    document.getElementById('frmname::content').reset();
    document.getElementById('f1::content').reset();
    $("input:visible:enabled:first").focus();
    </af:resource>
    </f:facet>
    </af:document>
    </f:view>
    </jsp:root>
    But that is not working. Can anyone help?
    Thanks

    My requirement is the form should get cleared on pressing ALT + F8.
    Here is my updated jspx page:-
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:inputText label="First Name" id="it1" value="#{MyBean2.firstName}">
    </af:inputText>
    <af:inputText label="Last Name" id="it2" value="#{MyBean2.lastName}">
    </af:inputText>
    <af:inputText label="EmailID" id="it3" value="#{MyBean2.emailId}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:inputText>
    <af:commandButton text="Submit" id="cb1"
    action="#{MyBean2.callSubmit}"
    binding="#{MyBean2.cb1}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:commandButton>
    </af:form>
    <f:facet name="metaContainer">
    <af:resource type="javascript" source="/js/jquery.hotkeys.js"/>
    <af:resource type="javascript" source="/js/jquery-1.4.4.min.js"/>
    <af:resource type="javascript">
    function clearAll() {
    jQuery('*').bind('keydown', 'Alt+F8', function (evt) {
    clearForm();
    evt.stopPropagation();
    return false;
    function clearForm() {
    curElm = document.activeElement;
    var frm = $(curElm).closest('form');
    var frmname = ($(frm).attr('name'));
    alert(frmname);
    document.forms[frmname].reset();
    $("input:visible:enabled:first").focus();
    </af:resource>
    </f:facet>
    </af:document>
    </f:view>
    </jsp:root>
    But still I am not able to get the desired functionality. Am i missing something here?
    Thanks

Maybe you are looking for

  • Graphic EQ settings not saving??

    Hi. I've just installed an old version of soundtrack 1.2 which I've never used before but I'm very familiar with other DAWs and finding this nice to use. I'm using it for live backing track purposes with 10 songs in sequence in their own tracks and t

  • Time machine:  cannot complete because sparsebackupdb temporarily unavailable   how do I fix that?

    my time machine will not complete because the file was and contines to be in use

  • Live cache install issue

    hello expert, I want to install a live cache server on a separate host, but failed more times, and got a same error messge every time as below, Some database applications are probably still running.Check the log file sdbinst.log. and the sdbinst.log

  • Integrate pdf (converted from smart form ) into portal

    Hi, My Requirement is as follows, We are using FPM framework and the application is developed on Webdynpro Java, When a end user fills up the details on this application form and clicks on a Review button, it will display the summary of the above det

  • ROW_NUMBER() and CONTAINS()

    Hello, I'm having a bit of bother with a view that uses ROW_NUMBER() and a query that uses CONTAINS(). I have a table A (A INTEGER, B VARCHAR2) and view V_A: SELECT A, B, ROW_NUMBER() OVER (ORDER BY A) N If I execute a query SELECT * FROM V_A WHERE C