Pre-populating dates

  • Profile Image
    Joeykoh96
    Asked on January 19, 2020 at 10:11 PM

    Hello,

    I need to pre-populate a form.

    I am currently doing 2 forms. And requires my second form to pre-populate some details from the first form.


    Using the name={name} coding, I am able to pre-populate some field over. However, I am currently jammed with the date picker field.


    I have been reading this post https://www.jotform.com/answers/1366410-Date-picker-field-Can-t-pass-the-date-from-one-form-to-another-when-field-is-in-lite-mode

    and some other post. But I cant seems to find the right code for the date picker field.


    I have tried both the &date202[month]={date201[month]} and &date202[month]={date201:month}


    Initially my code was month, day, year. So, I thought that maybe my field is im dd/mm/yyyy format so there might be a problem. I tried moving the codes around to day, month, year. But it still didnt work out.


    When the system generates the email to my respondent, the coding for other field looks like this, for example, &employeesName=Koh Sze Min&employeeID36= 246810. However, for the dates code it would be, &leavestart42[day]= &leavestart42[month]= &leavestart42[year]= . Basically, its empty without an "answer" that is required to fill up the form.


    First Form: https://form.jotform.com/200127585902452

    Second Form: https://form.jotform.com/200128009050438


    As you can see from my form, theres 3 date picker fields on each form. However, I would only like to bring over the first 2 dates from the first form to the second form.


    So initially I have used this code instead, &leavestart42={leavestart}. Despite the dates being shown here on the respondent email, when directed to the second form, the dates does not appear.


    https://form.jotform.com/200128009050438?session=joeyk@natsteel.com.sg24681012&employeesName=Koh sze min&employeeId25=24681012&employeesName40=Koh sze min&employeeId36=24681012&leaveStart42=22/01/2020&leaveEnd=27/01/2020

    TEST 1

    https://form.jotform.com/200128009050438?session=joeyk@natsteel.com.sg2468101221/01/2020&employeesName=Koh sze min&employeeId25=24681012&employeesName40=Koh sze min&employeeId36=24681012&leaveStart42[day]=&leaveStart42[month]=&leaveStart42[year]=&leaveEnd[day]=&leaveEnd[month]=&leaveEnd[year]=

    TEST 2

    https://form.jotform.com/200128009050438?session=joeyk@natsteel.com.sg2468101221/01/2020&employeesName=Koh sze min&employeeId25=24681012&employeesName40=Koh sze min&employeeId36=24681012&leaveStart42[day]={leaveStart32[day]&leaveStart42[month]=}&leaveStart42[year]=&leaveEnd[day]=&leaveEnd[month]=&leaveEnd[year]=

  • Profile Image
    roneet
    Answered on January 20, 2020 at 07:07 AM

    Please allow me some time to share the correct URL to pass the Date picker data.

    Thanks.

  • Profile Image
    roneet
    Answered on January 20, 2020 at 07:52 AM
  • Profile Image
    Joeykoh96
    Answered on January 22, 2020 at 02:25 AM

    Hi Roneet,


    Thank you for your reply. I managed to use this link to help me pre-populate the date picker field over. I am sharing it here for others who might be facing the same problem.


    https://form.jotform.com/200128009050438?session={email}{employeeId}{intendedCollection}&employeesName={employeesName28}&employeeId25={employeeId}&employeesName40={employeesName28}&employeeId36={employeeId}&leaveStart42[month]={leaveStart32:month}&leaveStart42[day]={leaveStart32:day}&leaveStart42[year]={leaveStart32:year} &leaveEnd[month]={leaveEnd:month}&leaveEnd[day]={leaveEnd:day} &leaveEnd[year]={leaveEnd:year}


    Just to check with you, is there any length limitation to the link? I might need to pre-population more fields that I have expected (maybe around 7 fields). I am afraid that there might be a length limitation affecting the pre-population.

    Hope to hear from you again.

    Thank you.


    Cheers!
    Joey :)

  • Profile Image
    roneet
    Answered on January 22, 2020 at 05:47 AM

    I believe any browser has this limitation when you are passing the URL parameters.

    Please check this article:

    https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers

    If the URL contains 2000 characters then it should work.

    Let us know if you have further questions.

    Thanks.