Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9017059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:10:04+00:00 2026-06-16T04:10:04+00:00

I’m using the following to post form data from a web app to both

  • 0

I’m using the following to post form data from a web app to both a server-side php and to quickbase. The fill.php processes the signature, appends it to a pdf, and emails the result.

Everything works fine, except I have no real success functions for this part:

$('#sendbtn').click(function(){

    signatures();

    $.post( 'https://www.quickbase.com/db/dbname?act=API_AddRecord', $('form').serialize());

    $.post( 'fill.php', $('form').serialize(), $.mobile.changePage('#successpop', {transition: 'pop', role: 'dialog'}));

});

The pop-up displays, but its not a true indicator of any success. How can I get a response back from one or both of these posts before displaying the success pop-up? It’d be great to conditionally go from one to the other post on success, but I’m not as worried about the QuickBase post. I definitely need to confirm the fill.php post before displaying success.

What I like about this is that it avoids a redirect to a url outside my app.

Thanks for any help!!

<form action="" encoding='multipart/form-data' encType='multipart/form-data'>
<input type=text name=_fid_6 >
<input type=text name=_fid_7 >
<input type=text name=_fid_8 >
<input type="hidden" name="img" id="img" />
<input type="button" value="Sign!" id="sendbtn" />
</form>  

        <script>
            $(document).ready(function() {
                $("#signature").jSignature()
            })
            function signatures(){
                var $sigdiv = $("#signature");
                var datax = $sigdiv.jSignature("getData","image");
                $('#img').val(datax);
                $sigdiv.jSignature("reset")
            }
        </script>

<script>
$(document).ready( function(){
    $('#sendbtn').click(function(){

        signatures();

        $.post( 'https://www.quickbase.com/db/dbname?act=API_AddRecord', $('form').serialize());

        $.post( 'fill.php', $('form').serialize(), $.mobile.changePage('#successpop', {transition: 'pop', role: 'dialog'}));

    });
});
</script>

<div data-role="page" id="successpop">
<div data-role="header" data-theme="c">
<h1>QAF Sent</h1>
</div>
<div data-role="content" data-theme="d">    
<h2>Your QAF has been sent</h2> 
<p><input type="button" data-inline="true" data-theme="b" value="Begin New QAF" data-icon="back" onclick="clearForm();"/></p>
</div></div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:10:05+00:00Added an answer on June 16, 2026 at 4:10 am

    One of these $.post()s will complete first and one will complete second. You don’t necessarily know which so set a global variable (like a Boolean) that is set to true on the completion of the first and then add a check for true. When the success function that sees the value as true have it call a onDoubleSuccess() function. Like so (demo):

    <script>
      $(document).ready( function(){
        $('#sendbtn').click(function(){
          var finishedFirstPost = false,
          onDoubleSuccess = function() {
            //code goes here
            $.mobile.changePage('#successpop', {transition: 'pop', role: 'dialog'});
          };
          signatures();
          $.post(
            'https://www.quickbase.com/db/dbname?act=API_AddRecord',
            $('form').serialize(),
            function() {
              if(finishedFirstPost) {
                onDoubleSuccess();
              } else {
                finishedFirstPost = true;
              }
            });
          $.post(
            'fill.php',
            $('form').serialize(),
            function() {
              if(finishedFirstPost) {
                onDoubleSuccess();
              } else {
                finishedFirstPost = true;
              }
            });
        });
      });
    </script>
    

    Also you can’t do an HTTP POST to an external domain without CORS support so you should change the Quickbase $.post() to $.get(). Here is the API documentation showing that this shoudl work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am using jsonparser to parse data and images obtained from json response. When
That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I am using Paperclip to handle profile photo uploads in my app. They upload
I am writing an app with both english and french support. The app requests
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm trying to create an if statement in PHP that prevents a single post
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.