• Resolved mpbaweb

    (@mpbaweb)


    Hello
    I would like to be able to set an ‘Expiry Date’ for a form. For example, my form allows competitors to enter for a race event, but there is a deadline date and time for entries to be made. Once this deadline is passed, I do not want the form to display, and the users should be redirected to another page or a message displayed.
    This is a common feature in most other form plugins, but I can’t see how to do this in CFF.
    Example of desired expiry settings:
    https://www.mpba.org.uk/wp-content/uploads/2018/03/form_expiry.jpg

    • This topic was modified 6 years, 12 months ago by mpbaweb.
    • This topic was modified 6 years, 12 months ago by mpbaweb.
    • This topic was modified 6 years, 12 months ago by mpbaweb.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @mpbaweb,

    Our plugin does not include this feature, however, it is very easy to implement, I will try to describe the process with an example:

    Assuming you want redirect the user to the URL: https://www.yourwebsite.com/message/
    when the form is loaded after March 7, 2018

    – Insert a calculated field in the form with the piece of code below as its equation:

    
    (function(){
    var current = new Date(), limit = new Date(2018, 2, 7);
    if(limit < current) document.location.href = 'https://www.yourwebsite.com/message/';
    })() 
    

    Note: Pay attention, the month is March, however, I’m using the number 2 for the month when the “limit” variable is defined (limit = new Date(2018, 2, 7)), in javascrit January is the month 0, February the month 1, March the 2, and so on.

    – Finally, the calculated field is used as auxiliary, so, you should tick the checkbox in its properties for hiding the field from the public page.

    and that’s all.
    Best regards.

    Thread Starter mpbaweb

    (@mpbaweb)

    Perfect.

    This really is the best plugin support I’ve ever experienced.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Form Expiry’ is closed to new replies.