What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Is there a way to send variables to a form I have created?

    Asked by ninman on April 09, 2015 at 10:17 AM

    I have an eLearning site for our company and I want to track results. I have set up variables, but I am having difficulty sending those variables to the coordinating form that I have created on JotForm.

     

    Here are my variables:

    var player = GetPlayer();
    $.ajax({
          url: "http://form.jotform.us/form/50984047371156",
          type: "POST",
          data: {"q1_courseTitle" :player.GetVar("CourseTitle"),
                   "q3_resultsStatus" :player.GetVar("ResultsStatus"),
                   "q4_scorePctg" :player.GetVar("ScorePctg"),
                   "q5_passingPctg":player.GetVar("PassingPctg"),
                   "q6_scorePoints" :player.GetVar("ScorePoints"),
                   "q7_passingPoints":player.GetVar("PassingPoints")},
          success: function (data)
          {
             alert(data);
          }
    });

     

    I could embed the form into the course, but I would prefer to have the results sent over executed by javascript when they open the page. That way we can ensure that the results are accurate and they have not mistyped any information or purposefully submitted that they passed when they did not.

     

    Thank you in advance for any assistance.

    Page URL:
    http://form.jotform.us/form/50984047371156

    variables POST submit data
  • Profile Image
    JotForm Support

    Answered by EltonCris on April 09, 2015 at 12:11 PM

    Hi,

    Unfortunately, that's not going to work with Jotform. You have to use Jotforms API endpoint api.jotform.com in order to submit data to your form.

    Here's a guide for that: http://api.jotform.com/docs/#post-form-id-submissions

    However, if you only want to prepopulate data to your form through URL parameter, here's a guide: http://www.jotform.com/help/71-Prepopulating-the-fields-to-your-JotForm-via-URL-parameters

    Let us know if you need any further assistance.

    Best Regards!