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

    Help with field validation

    Asked by sbohler on June 12, 2014 at 05:41 PM

    Greetings,

    Here is my form:  http://form.jotformpro.com/form/41495760669973

    I need to validate the Month and Year fields to disallow past selections.  For example, it is June now and if a user selects a month value of January-May I want a standard validation error message to appear as it does with other field validations.

    I can't use the Date/Time selector as I need the individual dropdown fields to appear as they do now.

    Can you provide me with a validation method?  I suspect some simple javascript will do the job but I'm not sure how to go about it.

    Please help.

    Thank you,

    Scott

    Page URL:
    http://form.jotformpro.com/form/41495760669973

    message validate selector and
  • Profile Image
    JotForm Support

    Answered by Mike_T on June 12, 2014 at 06:22 PM

    This is not currently possible to do that using standard form builder functionality, but it might be possible with the custom javascript code. We will try to come up with some example, and then we will get back to you.

    Thank you.

  • Profile Image
    JotForm Support

    Answered by Mike_T on June 13, 2014 at 12:00 PM

    You can try to include the following form code after form source:

    http://pastebin.com/raw.php?i=Xxa7NWL6

    Example with a cloned version of your form:

    https://shots.jotform.com/mike/examples/date-validation.html

    If you need any further assistance, let us know.

  • Profile Image

    Answered by sbohler on June 13, 2014 at 04:46 PM

    It looks like that works.  I'll give it a try...

    Thank you!

    Scott

  • Profile Image

    Answered by sbohler on June 13, 2014 at 06:10 PM

    This works but has a a couple of minor problems.

    How do we make it:

    - not insert a line at the top of the form (not move the rest of the form down)

    - display only 1 error message (it's duplicating upon more selection attempts)

    - position the error relative to the Month selector?

    Thank you very much.

    Scott

  • Profile Image
    JotForm Support

    Answered by jonathan on June 13, 2014 at 06:47 PM

    Hi Scott,

    Than you for providing more details.

    I will try to fix the solution provided by our colleague Mike_T to matched per your requirements.

    I will provide update here as soon as I can.

  • Profile Image

    Answered by sbohler on June 18, 2014 at 07:11 PM

    Thanks Jonathan and Mike.

    Any update?

    Scott

     

  • Profile Image

    Answered by sbohler on June 19, 2014 at 03:24 PM

    Jonathan,

    Can you give me a status?  This is urgent for my client.

    Many thanks,

    Scott

     

  • Profile Image
    JotForm Support

    Answered by Mike_T on June 19, 2014 at 03:25 PM

    I will try to make the adjustments later today. I am sorry for the delay.

  • Profile Image
    JotForm Support

    Answered by Mike_T on June 19, 2014 at 06:57 PM
  • Profile Image

    Answered by sbohler on June 21, 2014 at 01:41 PM

    Thank you Mike - this looks great!

    Have a wonderful weekend,

    Scott

     

  • Profile Image

    Answered by sbohler on July 02, 2014 at 02:14 PM

    This worked very well.  :)

    Thanks Mike,

    Scott

     

  • Profile Image
    JotForm Support

    Answered by Mike_T on July 02, 2014 at 03:24 PM

    You are quite welcome Scott. Feel free to contact us anytime :)