POST data to auto-fill form

  • Profile Image
    trinitygr
    Asked on May 18, 2013 at 08:32 PM

    PLEASE SEND REPLYS TO SUPPORT@IEDITS.COM.

     

    My name is Shane and I am working for an insurance company as the website designer. I was hoping to find a way to be able to have a field (not part of the form) on a seperate page that would ask for a zip code. Once entered, it would automatically fill in fields in the actually form for the user.

    e.g.
    Enter ZIP: 27055 (<-- This is the zip code of Yadkinville)
    [CLICK BUTTON]
    [REDIRECTS TO FORM]
    Location: Yadkinville, NC [Auto-filled]


    I know Mailchimp offers widgets that automatically take the email address to subscribe a user. The widget asks just for the email address and then redirects the user and automatically fills in the fields.

    I know that may take some custom coding on my part but I'm not sure where to begin with this, can you help me?
    FYI, I'm currently not on any deadline so no pressure if you can help me.

  • Profile Image
    EltonCris
    Answered on May 19, 2013 at 12:13 AM

    Hi,

    That's possible. Try using the following PHP on your first form.

    <?php

    $zip = $_POST['zip']; //replace zip with the name field on your zip text box

    $form= "http://form.jotform.us/form/31317955697164?primaryAddress[postal]=".$zip;

    header("location:$form");

    ?>

    Save this as PHP file e.g. myform.php and set it as your first form's action URL. Example:

    <form action="myform.php" method="post" ....

    As a result, when the user enters zip code and hit submit they will be directed to your form with the zip prepopulated on the zip code field of your form.  Example: http://form.jotform.us/form/31317955697164?primaryAddress[postal]=123567

    Let us know if you need further clarification. Thanks!

  • Profile Image
    khrisell
    Answered on July 04, 2013 at 06:44 PM
    Greetings!

    We are happy to announce that we have released Jotform Webhooks,  this feature would replace Send Post Data + Custom URL Thank You Page workaround in order to help you transfer forms data to your own database using your own script codes.

    To know more about Jotform Webhooks, please click here.

     

    Thank you for using JotForm. :)