FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form is active for a date range
#1
Would it be possible to use an end date on a form, after which time the form is unavailable? For example, if a sports league had a sign-up/registration form available until May 31, on June 1, the form page would read, "Sorry, this form is no longer available." This would allow a Client to "forget" about the form and the need to disable it at 12:01am on June 1st.

The end date would be available to edit by the Admin as well as by an assigned Client.
Reply
#2
Hi Xulu,

Neat idea! But this would really only be plausible if the forms themselves were generated by Form Tools. What I mean is, Form Tools forms are very much their own entities.

Instead, what you can do is add some PHP to the top of your form page that automatically redirects your users after a certain date. I haven't tested this, but it would look like this:

PHP Code:
$offline_date  mktime(0,0,0,6,21,2009); // June 21st, 2009
$current_date date("U");

if (
$current_date $offline_date)
{
  
header("location: form_unavailable.php");
  exit;


(Make sure you wrap it in <?php and ?> tags - for some reason this forums editor is stripping them out).

Hope this helps!

- Ben
Reply
#3
I see your point. When the form page is called, I would have to query a DB setting to see what the set date is.

Thinking about this some more, perhaps in the same way when when a form is initialized and I am instructed to add the following code:

PHP Code:
require_once("path/to/form_tools/global/api/api.php");
$fields ft_api_init_form_page("""test");
$params = array(
  
"submit_button" => "submit_button_name_attribute",
  
"next_page" => "next_page.php",
  
"form_data" => $_POST
    
);
ft_api_process_form($params); 

...selecting an end date during the form initialization process (Admin capability only) will generate the code to add as you provided above. If I (the Admin) ever change the end date within the form management process, I would be instructed/prompted to add modified code.

Oh well, just thinking out loud. I'll probably play around with this soon. Thanks for letting me use you as a sounding board.

Adam
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)