Skip Navigation

[Resolved] Close form on a date

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 11 months, 1 week ago.

Assisted by: Waqar.

Author
Posts
#2680366

Tell us what you are trying to do?
I have an entry form which creates a post. Entries close on January 31.
Is there a way to automatically close the form on Feb 1st and have a message saying 'Entries Closed'

It's an Edit Post Form which then goes to Woocommerce for payment.

#2680378

Hi,

Thank you for contacting us and I'd be happy to assist.

To achieve this, you can use the UNIX timestamp value of the date 'Feb 1st' ( 1706745600 ), in conditional statements:
( ref: https://toolset.com/documentation/legacy-features/views-plugin/conditional-html-output-in-views/ )

For example:


[wpv-conditional if="( 'NOW()' gt '1706745600' )"]
  Form entries are now closed!
[/wpv-conditional]
  
[wpv-conditional if="( 'NOW()' lt '1706745600' )"]
  [cred_form form="Form name"]
[/wpv-conditional]

The first conditional block will show the message 'Form entries are now closed!' if the current date/time value is greater than that of February 1st.

The second one will show the form if the current date/time value is lower than that of February 1st.

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2680380

Thank you