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 pass registered user data from Joomla or other to Jotform

    Asked by tuyeni on April 26, 2014 at 06:37 PM

    When a registered user on my site lets say clicks on book an appointment or something of that nature, their user data (name, address, email etc) gets passed onto a form on Jotform and they complete the rest of the fields.

     

    Also if its possible, afterward, the completed form data is also transfered back to the user account so they can see their booking when logged in.

     

    Thanks!

    JotForm email name form data
  • Profile Image
    JotForm Support

    Answered by EltonCris on April 26, 2014 at 09:25 PM

    Hi,

    The first one is possible when you use your form source code or iframe embed code then apply prepopulation method. Write custom php script that grab the current login user info and then print it to the form. I think this is pretty complicated to achieved so I suggest you to hire php developer to do the job. However, if you'd like to give it a shot, you can use this as reference: http://docs.joomla.org/JFactory/getUser

    Here you can take this as an example code. This grabs the current logged in username and populates it to the form field.

    <?php

    $user = JFactory::getUser();

    if (!$user->guest) {

    $username = $user->username;

    //$realname = $user->name;

    }else{

    $username = "guest";

    }

    ?>

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="https://secure.jotformpro.com/form/40924949465972?username=<?=$username;?>" frameborder="0" style="width:100%; height:465px; border:none;" scrolling="no"></iframe>

    About your second question, I'm sorry but I have no clue how this can be achieved. I think you have to get access with your Joomla database and connect it the form. So it's basically like form to MySQL setup. You can refer to this guide, this might give you some insights. http://www.jotform.com/help/126-How-to-Insert-Update-Submissions-to-Your-MySQL-Database-Using-PHP

    Thank you!