How to make a field must include certain characters.

  • digitalmedia
    Asked on October 22, 2014 at 7:29 AM

    Hi, Is it possible to make a filed which the user has to enter a certain number of characters and number before it will let them continue? for example we need a field on our form to contain 1 capital letter followed by 12 numbers.

     

    Regards

     

    Dave Rudge

  • Ashwin JotForm Support
    Replied on October 22, 2014 at 11:22 AM

    Hello Dave,

    You may like to take a look at our "Input mask" feature which will help you achieve your requirement. You cannot set it to ensure user input in capital letter but 1 letter and then 12 numbers can be ensured. Please check the screenshot below:

    How to make a field must include certain characters Screenshot 20

    If you want to ensure that the letter is capitalized then you can do that by injecting the following custom css code:

    input#input_4 {

    text-transform: uppercase;

    /* You need to actually change the field id*/

    }

    The following guide should help you in injecting custom css code:  https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes 

    Please take a look at the following demo form where I have added the custom css code and set the input mask:  http://form.jotformpro.com/form/42935077043960? 

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!