-
sbohlerAsked 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_TReplied 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_TReplied 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.
-
sbohlerReplied on June 13, 2014 at 4:46 PM
It looks like that works. I'll give it a try...
Thank you!
Scott
-
sbohlerReplied 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
-
jonathanReplied 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.
-
sbohlerReplied on June 18, 2014 at 7:11 PM
Thanks Jonathan and Mike.
Any update?
Scott
-
sbohlerReplied 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_TReplied on June 19, 2014 at 3:25 PM
I will try to make the adjustments later today. I am sorry for the delay.
-
Mike_TReplied on June 19, 2014 at 6:57 PM
Here is updated version:
http://pastebin.com/raw.php?i=7S0ekEr4
Example:
https://shots.jotform.com/mike/examples/date-validation-v2.html
Thank you.
-
sbohlerReplied on June 21, 2014 at 1:41 PM
Thank you Mike - this looks great!
Have a wonderful weekend,
Scott
-
sbohlerReplied on July 2, 2014 at 2:14 PM
This worked very well. :)
Thanks Mike,
Scott
-
Mike_TReplied on July 2, 2014 at 3:24 PM
You are quite welcome Scott. Feel free to contact us anytime :)