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

    prevent the date/function from accepting dates in the past

    Asked by imaginetek on April 05, 2012 at 01:05 PM

    Hi, I have set up a form using the date/time function in one section to input an order date. I would like to know if there is a way to prevent a date being entered that is before the date of entry e.g. 4th March, when form filled in on 5th March?

    Thanks

  • Profile Image

    Answered by gori-mathew on April 05, 2012 at 04:07 PM

    Hi,

    Thanks for this concern. unfortunately, to the best of my knowledge, what you want to do is not currently possible with our forms.

    I though have some thread on an almost workaround solution and request you to have alook .  http://www.jotform.com/answers/18819-Conditional-Forms-with-date-input

    Please if you have any question lets know and will assist you.

  • Profile Image

    Answered by imaginetek on April 05, 2012 at 04:37 PM

    Thanks for the reply. Unfortunately the link doesn't really help as I want the notification/rejection to come before submission.

    I think it would be auseful feature to build into a future update, where the condition could be made to check for greater or less then a parameter which is set to be the current date.

  • Profile Image
    JotForm Support

    Answered by jonathan on April 05, 2012 at 06:20 PM

    @imaginetek,

    You can also achieve this for now (since it is not yet in the feature) by adding some javascript function in the form's source code. The only way to compute/compare field values are thru inclusion of javascripts functions. In this scenario, using javascripts you can compare/validate the user inputted date field(text box) thru the "Date()" javascript function. 

    But this will require you to use the form's source code and deploy it as a page in your website, because the javascripts can only be included in this way.(you cannot embed or inject javascripts).

    How to download a source code of your Form.

    Hope this helps you in anyway. Thanks.

  • Profile Image

    Answered by imaginetek on April 05, 2012 at 06:58 PM

    Thanks for the further feedback, sounds like a project challenge (saying I'm no javascript expert would be a HUGE understatement). If anyone can provide some actual code tips/examples that would make this work I'd really appreciate it :)

  • Profile Image
    JotForm Support

    Answered by jonathan on April 05, 2012 at 07:00 PM

    Ok imaginetek. I will provide you direction and sample how to achieve it. Please give me time to prepare it for you.

    Thanks.

  • Profile Image
    JotForm Support

    Answered by jonathan on April 07, 2012 at 05:08 AM

    Hi imaginetek,

    As previously committed, here is a demo of the workaround using javascript function on the form to prevent none valid dates being used on the date field. You may check your form which I cloned and used its source code to add some simple javascripts function to achieve the requirements.
    In the demo, if you put date less than the current date(today), if you click on the next required field, a pop-up message will inform you of the order date being an invalid date. The function can be easily modified to prevent the user from continuing instead(i.e. hide next fields or submit button).

    If you are interested to pursue these option, I will provide you the javascripts (which you can actually see also in the source code of the demo page), and assist you in setting it up.

    Hope this helps you in anyway. Thanks.

  • Profile Image

    Answered by imaginetek on April 08, 2012 at 12:32 PM

    Hi Jonathan,

    Wow, thanks for your help with my problem. I've put the code in and it works brilliantly. I really am grateful that you took the time to respond to this. I have already told a few people about it and told them to check out jotform. It's this kind of support which makes a difference and the whole project deserves every success.

    The only issue I have is that if you look at the link where I have put the code: http://www.imaginetek.co.uk/T2G/order2.html I have lost the formatting. Do you need to provide me with some css code? Also I'm not sure where the ">>" symbols are coming from next to the category titles. Appreciate any further tips.

    Cheers

  • Profile Image
    JotForm Support

    Answered by jonathan on April 08, 2012 at 03:35 PM

    Hello imaginetek,

    Thank you very much for considering JotForm and our service, and even the good feedback.

    I checked your website and saw the problem. This happen because I think you actually copied the whole thing from the demo page. It was meant to demo only the javascripts.
    Anyway, I have seen your actual 'order html' page, I will copy that and apply the whole functions need so you can use them right away. I will provide you the steps later how to transfer it to your page.

    Please wait a while. I'll be back in a sec.

     

  • Profile Image
    JotForm Support

    Answered by jonathan on April 08, 2012 at 07:05 PM

    Hi,

    Here is the revised html page. Please check if the functionality is enough with you.

    To apply this on your website

    1. Copy the source code of this web page and create your new html page where you can easily reference it. This is the JotForm source code of your clone Order form. See the screen below of the directory of my sample site. order2.html is the JotForm form.

     

    2. In your own order.html , insert/paste the iframe source code similar to the highlighted code in the screen below. You can also get the code in the demo page (in your browser, righ-click and view source code, then copy that iframe codes so you can paste it in your order.html file)

    Basically, what it does is call the JotForm Order form from another page using iframe. We had to do this because your theme site stylesheet is using other javascripts which conflicts with JotForm scripts and class styles.

    Hope this work for you. Inform us should you require further assistance.

    Thanks.

  • Profile Image

    Answered by imaginetek on April 09, 2012 at 10:40 AM

    Hi again,

    Your solution worked perfectly. The result is spot on.

    Once again I must convey my thanks to you on this and the way you have given up your time to follow it through to a solution. You certainly have a convert here and I'll make sure as many people as possible know about JotForm.

    Here's wishing you and the JF team growing success and recognition in the future.

  • Profile Image
    JotForm Support

    Answered by jonathan on April 09, 2012 at 06:39 PM

    Hello imaginetek,

    We are glad that it worked out for you.
    Thank you for taking the time updating us on the status and giving the good feedback and comment as well. Nothing much I really did, this is just the way we provides service here. =) 
    Having good customers like you with us, represents JotForm and our service as well.

    Feel free to contact us anytime should the needs arises again for assistance.

    regards,