How to give a dynamic ID, racking number to the Form?

  • KriyaYogaVienna
    Asked on January 13, 2015 at 8:33 AM

    From a dropdown the user can choose:

    CourseA

    CourseB

    CourseC

     

    The submissions I get shall have the unique ID (used for tracking wire transfer payment):

    for courseA

    A-0001, A-0002, A-0003 and so on

    for courseB

    B-0001, B-0002, B-0003, ...

    and so on

    The Widget Unique ID does not really allow this, nor can I change the letter "A", "B", "C" with conditions since the unique ID field is not available in the condition fields.

    How can I do this?

  • Mike
    Replied on January 13, 2015 at 10:15 AM

    Thank you for contacting us.

    The Unique ID is being generated upon submission, so unfortunately, there is no way to play around it.

    If the autoincrement number is not critical, it is possible to generate a random number with a Random Value Generator widget. Then, use that random number with some index like A-random number, B-random number, etc.

    Take a look at this form:

    http://form.jotformpro.com/form/50124073054947

    If this is something that might work in your case, let us know. We can explain how it works, and hide the IDs if needed.

  • KriyaYogaVienna
    Replied on January 13, 2015 at 12:35 PM

    This would be a good solution.

    I cloned your example to see how you did it. But still I can't understand the calculations in the field "Random ID". How could you add the calculater there? It is not the calculation widget but the Random Value Generator widget!

    And what does the

    A # {course}

    do?

    Do I hide the fields simpy with conditions?

    I like the field Dynamic ID to be displayed, but then it should not be able to edit it by the user. If this is not possible, I prefer to hide it and send the code by email (this I know how to do)

  • David JotForm Support
    Replied on January 13, 2015 at 1:39 PM

    Hi,

    The setup of the form my colleague referenced is as follows.  The first field is simply a dropdown with your course selections.  The second field is a random ID field that generates a random string.  The third field is a calculation field.  The calculation field is only used to combine the Course selection and the random ID using conditions:

    How to give a dynamic ID, racking number to the Form? Image 1 Screenshot 20

    Basically, If CourseA is selected, "A-" + "Random ID" is inserted in the the calculations field.

    To set the field to read only, add this CSS to your form:

    http://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes

    .form-line.calculatedOperand {
        -webkit-user-select : none;
        -moz-user-select : none;
        -ms-user-select : none;
        -o-user-select : none;
        user-select : none;
    }

    Let us know if you have any further questions and we will be happy to help.   

  • KriyaYogaVienna
    Replied on January 13, 2015 at 5:58 PM

    My biggest question actually was:

    How could you add the calculation field here?:

    How to give a dynamic ID, racking number to the Form? Image 1 Screenshot 30

    if I click on it I get this window:

    and what does this calculation mean?:

    and what does the"#"?

    How to give a dynamic ID, racking number to the Form? Image 2 Screenshot 41

     

    I tried to reproduce it but was not successful with it.

  • jonathan
    Replied on January 13, 2015 at 7:18 PM

    Hi,

    The calculation is NOT being done on the Calculation widget..

    It was actually by using Conditional Statement 

    How to give a dynamic ID, racking number to the Form? Image 1 Screenshot 20

     

    I suggest you also check the user guide: 

    -How-to-Insert-Text-or-Mathematical-Calculation-into-a-field-using-a-Condition

     

    Hope this help. Please inform us if you need further assistance.

    Thanks.

     

  • KriyaYogaVienna
    Replied on January 13, 2015 at 8:00 PM

    I know this, but how do you combine the "A-" and the random id????

    Now I found the solution myself:

    How to give a dynamic ID, racking number to the Form? Image 1 Screenshot 50

    This calculation opens and you add "c-" and Add Field

    and check "add field to equation as text by default"

    How to give a dynamic ID, racking number to the Form? Image 2 Screenshot 61

     

    So it is solved.

    I just wonder where does this yellow button come from? I don't have it in my testing.

    How to give a dynamic ID, racking number to the Form? Image 3 Screenshot 72

     

    How to give a dynamic ID, racking number to the Form? Image 4 Screenshot 83

     

    I feel thankful to all of you who helped me. I did not expect such a wonderful service. It's amazing. Really! Thank you!

  • KriyaYogaVienna
    Replied on January 13, 2015 at 8:56 PM

    By the way:

    The css code does not work.

    .form-line.calculatedOperand {
        -webkit-user-select : none;
        -moz-user-select : none;
        -ms-user-select : none;
        -o-user-select : none;
        user-select : none;
    }

     

    I suppose because I used the Designer a little. It added a LOT of code to my Inject Custom CSS.

    If I use it after adding code it will delete all custom code and after using the Designer some custom code will not work.

     

    I deleted the css code from the Designer but it doesn't work anyway.