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

    How to have input validation with existing MySQL database

    Asked by DW  on November 11, 2014 at 08:24 PM

    I have a simple online registration form already, but it is limited and so are my php and javascript skills. What I cannot do currently is have a user register for an event with validation back to an existing MySQL table. Basically, they would enter in their "license" number and it would validate that number against the database and then pre-fill most of the form fields. Once the form is submitted the results would populate a different database for that particular event.

    I would also like the user to be able to select more than one "license" number or "product" before submitting the form for payment (I have an Authorize.net account already) so they can make one payment for multiple registrations.

    I read in the forum that some of this looks possible, can anyone confirm that I can accomplish these objectives with JotForm?

    JotForm registration form table license custom solutions database programming
  • Profile Image
    JotForm Support

    Answered by jonathan on November 11, 2014 at 08:57 PM

    Hi,

    Thank you for contacting us.

    We recommend that you also create an account first before proceeding. You can use this link https://www.jotform.com/signup to signup using your email account.

    We will be able to attend to your specific post/question when you have an account.

    --

    As to your inquiry, base on the details you had provided, it will indeed require custom programming that will use sever-side application like PHP to achieve the requirement.

    The very first thing needed is to enable Send Post Data (HTTP POST) in your jotform

     

    then, use custom URL thank you page the post the submission data

     

    The posted submission data can be parse by the custom PHP script similar to what was described on this user guide

    https://www.jotform.com/help/126-How-to-send-Submissions-to-Your-MySQL-Database-Using-PHP

    --

    As you may have noticed already, your requirement needs advance knowledge in programming to accomplish the custom solution that involves your existing MySQL database.

    You will most likely require a dedicated programmer that can create this solution for you as there is a need to access your existing MySQL database in order to develop the solution.

    We can assist you on most initial requirements that does not involve the core programming just like what I have initially provided.

    Just contact us again anytime if you need further assistance.

    Thanks.

     

     

     

     

     

  • Profile Image
    JotForm Support

    Answered by jonathan on November 11, 2014 at 09:01 PM

    Addition:

    If the database validation is not your core requirement, you can also create custom validation that involves using only Webhook with JotForm

    http://www.jotform.com/help/245-How-to-Setup-Webhook-with-JotForm

    You can check samples here http://www.jotform.com/help/248-Webhook-Samples

     

    Thanks.

     

  • Profile Image

    Answered by Darrenjamesw on November 11, 2014 at 09:45 PM

    Thanks. I have signed up. The sending form data to MySQL with PHP I can probably figure out. What about pre-populating fields based on a table look-up? For my example, I want a user to enter their license number and have most of the other form fields populate from the look-up database. Basically a poor mans user log-in. Maybe the webhook solution would work for that?

    Also, the ability to do several registrations and entries with one payment is a definite goal.

  • Profile Image
    JotForm Support

    Answered by ashwin_d on November 12, 2014 at 12:38 AM

    Hello Darrenjamesw,

    What about pre-populating fields based on a table look-up? For my example, I want a user to enter their license number and have most of the other form fields populate from the look-up database.

    Unfortunately, it is not possible to achieve your requirement within the form editor. There is no way to populate the data from any external source. I believe with a little workaround, it is possible to achieve your requirement. Here are the steps you should follow:

    1. Create a PHP page in your server which will accept the license number as query string. It will query the MySQL DB and fetch the data related to the license number.

    2. Add a function in your PHP page where, the data can be populated in the JotForm fields. To achieve this, you can take advantage of our "URL Parameters" feature and then redirect users to JotForm with URL parameters. When the form is loaded, it will display the data in the form fields. The following guide should help you:  http://www.jotform.com/help/71-Prepopulating-fields-to-your-JotForm-via-URL-parameters 

    Also, the ability to do several registrations and entries with one payment is a definite goal.

    I am not sure if I have understood your question correctly. I would suggest you to explain your this question a bit more in detail.

    We will wait for your response.

    Thank you!

  • Profile Image
    JotForm Support

    Answered by jonathan on November 12, 2014 at 09:29 PM

    Hi,

    Please check this thread

    http://www.jotform.com/answers/115850-Using-AJAX-to-validate-a-form

    I believe this will help in better understanding what exactly you need to have and do to come up with you custom input validation solution.

    Please continue updating us for further assistance you need on the subject.

    Thanks.

     

  • Profile Image

    Answered by Darrenjamesw on November 13, 2014 at 01:24 PM

    Yep. That is very similar to what I am trying to accomplish. It's a start in the right direction