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
    JotForm Support

    How does one pre-fill the Full Name field correctly?

    Asked by abajan on January 23, 2011 at 01:20 PM

    In relation to another topic which this post used to be a part of, how should the confirmation link be coded so that the user's first and last names show up in their respective text boxes? This screenshot shows the confirmation link's string (see browser's address bar) generated for a fictional user named John Doe. The code used to generate that string is http://www.jotform.com/form/99999999999?fullName1={fullName1}&email3={email3} ("99999999999" was substituted for the real ID to prevent abuse of the live form.) How should I rewrite the link to get the user's first name (John, in this case) to appear in the first text box and the last name (Doe, in this case) to appear in the second?

    Here's how I want John Doe's name to appear in form b:

    First and last names in their respective text boxes

     

    Thanks in advance.

    P.S. I just realized that it would be a good idea to remove the asterisks so users don't feel compelled to enter something into the fields (even though information is already there).

    pre-fill field full name split separate
  • Profile Image

    Answered by serkan on January 24, 2011 at 08:21 AM

    Good question. In order to populate field with multiple items you should also pass the field name in the URL for example correct version of your link should be:

    http://www.jotform.com/form/99999999999?fullName1[first]=John&fullName1[last]=Doe

    You can get these names from the source code.

  • Profile Image
    JotForm Support

    Answered by abajan on January 25, 2011 at 11:02 AM

    Thanks for your response, serkan.

    The code you provided certainly works when the confirmation link is written exactly as you have shown, with "John" appearing in the First Name field and "Doe" in the Last Name field. However, what I really need is the tags that will dynamically insert the user's first and last names into their correct fields, according to what her first and last names actually are. For instance, I wouldn't want a user who entered the name Mary Poppins in the initial (registration) form to have her confirmation form pre-filled with the name John Doe!

    The email tag is no problem: {email3} dynamically generates whatever email address the user would have entered into the email address field of the form. Initially, I got the email tag from the confirmation form's source. All that was required was for me to change q3_email3 into {email3}. In other words, I stripped q3_ from the beginning and wrapped email in braces. Figuring that I needed to do the same with the first and last name fields, I changed q1_fullName1[first] into {fullname1[first]} and similarly, q1_fullName[last] into {fullname1[last]} but it didn't work. When I tested my original confirmation link (http://www.jotform.com/form/99999999999?fullName1[first]={fullName1[first]}&fullName1[last]={fullName1[last]}&email3={email3}), it showed up in the user's autoresponse as http://www.jotform.com/form/99999999999?fullName1[first]=&fullName1[last]=&email3=username@domain.com. In other words, instead of the first and last name tags generating the user's first and last names (in accordance with what she had entered into those fields in the registration form), those tags were simply stripped from the link when viewed in the autoresponse message. However, the {email3} tag worked as expected and generated the email address entered by the user. I used username@domain.com in the generated confirmation link above as an example but let's say a user named Mary Poppins had entered the email address marypoppins@flyingnanny.com, it would have dynamically generated marypoppins@flyingnanny.com).

    So, I need to know what to change in {fullname1[first]} and {fullname1[last]} in order for them to work like {email3} does for the email address. It would appear to be the brackets ([]) that are causing the tags to disappear. If that is the case, how should I re-write those tags?

    (Incidentally, if others trying this are having difficulty getting the tags in the registration form to match those in the confirmation form, that was achieved by cloning the registration form and then removing the fields I didn't need from what was now the confirmation form.)

  • Profile Image

    Answered by serkan on January 25, 2011 at 03:46 PM

    I see what you mean. You want to access the parts of an answer from tags for example {fullName:first} or {address:country}

    We don't have this feature yet. However, it seems very logical and relatively easy to implement. I'll add this soon.

    Thanks.

  • Profile Image

    Answered by serkan on January 27, 2011 at 06:06 AM

    @abajan I've implemented this feature now. Please try it again and let me know if it's working for you.

    Thanks.

  • Profile Image
    JotForm Support

    Answered by abajan on January 27, 2011 at 10:16 AM

    It worked perfectly, serkan. Thanks a million! :)

  • Profile Image

    Answered by snicker on February 26, 2015 at 03:01 PM

    I get fullName#{first} in my first name field for instance.
  • Profile Image
    JotForm Support

    Answered by abajan on February 26, 2015 at 04:30 PM

    @snicker

    This is a pretty old thread. I've moved your question to another thread where a reply will be posted to in due course. Here's where to find that thread: http://www.jotform.com/answers/523518.

    Thanks