Help with field validation

  • sbohler
    Asked on June 12, 2014 at 5: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

  • Mike_T Jotform Support
    Replied on June 12, 2014 at 6: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.

  • Mike_T Jotform Support
    Replied 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.

  • sbohler
    Replied on June 13, 2014 at 4:46 PM

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

    Thank you!

    Scott

  • sbohler
    Replied on June 13, 2014 at 6: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

    Help with field validation Image 1 Screenshot 20

  • jonathan
    Replied on June 13, 2014 at 6: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.

  • sbohler
    Replied on June 18, 2014 at 7:11 PM

    Thanks Jonathan and Mike.

    Any update?

    Scott

     

  • sbohler
    Replied on June 19, 2014 at 3:24 PM

    Jonathan,

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

    Many thanks,

    Scott

     

  • Mike_T Jotform Support
    Replied on June 19, 2014 at 3:25 PM

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

  • Mike_T Jotform Support
    Replied on June 19, 2014 at 6:57 PM
  • sbohler
    Replied on June 21, 2014 at 1:41 PM

    Thank you Mike - this looks great!

    Have a wonderful weekend,

    Scott

     

  • sbohler
    Replied on July 2, 2014 at 2:14 PM

    This worked very well.  :)

    Thanks Mike,

    Scott

     

  • Mike_T Jotform Support
    Replied on July 2, 2014 at 3:24 PM

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