Help with field validation

  • Profile Image
    sbohler
    Asked 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

  • Profile Image
    Mike_T
    Answered 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
    Mike_T
    Answered 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
    sbohler
    Answered on June 13, 2014 at 04:46 PM

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

    Thank you!

    Scott

  • Profile Image
    sbohler
    Answered 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
    jonathan
    Answered 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
    sbohler
    Answered on June 18, 2014 at 07:11 PM

    Thanks Jonathan and Mike.

    Any update?

    Scott

     

  • Profile Image
    sbohler
    Answered 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
    Mike_T
    Answered 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
    Mike_T
    Answered on June 19, 2014 at 06:57 PM
  • Profile Image
    sbohler
    Answered on June 21, 2014 at 01:41 PM

    Thank you Mike - this looks great!

    Have a wonderful weekend,

    Scott

     

  • Profile Image
    sbohler
    Answered on July 02, 2014 at 02:14 PM

    This worked very well.  :)

    Thanks Mike,

    Scott

     

  • Profile Image
    Mike_T
    Answered on July 02, 2014 at 03:24 PM

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