This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Disable form after set number of entries?


  1. PDXMan
    Member

    We are using MachForm for class registrations. We are looking at ways to limit how many people can register for an class. Some classes have limited seating.

    Question 1. Is there a way to disable the form and/or show a special "success message" once a set number of submissions have been reached?

    Question 2. Is there a way to display in the form (so users can see it) how many times the form has been submitted? If we could do that we could also show users how many seats are still available in a class at any given time.

    Thanks so much.

    Posted 15 years ago #
  2. redityo

    Hi,

    For your questions :

    1. You can use the method in this post :

    http://www.appnitro.com/forums/topic/limit-number-of-applications?replies=2

    2. To do this, you need to edit "includes/view-functions.php" file. Go to around line 1824 and you will see this code :

    $form_markup = <<<EOT

    then put these code above that line

    if ($form->id == 2) {
    	$query = "SELECT count(1) total_row FROM ap_form_".$form->id;
    	$result = do_query($query);
    	$row = do_fetch_result($result);
    	$show_total_entry = '<ul><li style="text-align:center"><strong>This form already submitted '.$row[0].' times</strong></li></ul>';
    }

    then go to line 1849 to find this code :

    {$form_desc_div}

    and put this code bellow that line

    {$show_total_entry}

    in there I assume your form id is 2 , don't forget to change the ID's with yours.


    MachForm Support

    Posted 15 years ago #

RSS feed for this topic

Reply