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

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Remove/don't display form at all when disabled


  1. zforray
    Member

    I am trying to setup a page that contains the code for 5-forms (1-per week of a month) where the forms visibility is controlled by the date-range. The problem I have is the huge blank spacing that is left for each inactive form. I already edited language.php to completely blank-out the "this form is inactive message" since that would simply confuse folks to see it 4-6 times (my folks want to include extra weeks if possible).

    What code can I change so that if a form is inactive, it simply exists and doesn't do anything at all - including blank lines/spacing.

    I am using the embed PHP code since you can't have multiple forms on one page using the Javascript option.

    Posted 10 years ago #
  2. yuniar

    You can try editing "includes/view-functions.php" file. Search around line 4552 for this code:

    if(empty($form->active) || $form_has_maximum_entries){

    below that line, add this code:

    return '';

    MachForm Founder

    Posted 10 years ago #
  3. zforray
    Member

    Thanks, Yuniar, that took care of hiding the forms. However, the other problem I have is that since there is "spam protection" on all of the entries, answering the spam protection question on the displayed form then pops-up/reveals ALL of the hidden forms telling me I need to answer their "spam protection" questions as well.......

    My test page is here:

    http://swiftcreekbaptist.org/Resources/Menu_test.htm

    Posted 10 years ago #
  4. zforray
    Member

    Another issue. I went through and removed all the "spam protection" (until you respond with a possible way to get around the problem) and then when I submitted/continued (since I had "review" option enabled), it errored the hidden forms with:

    Warning: Invalid argument supplied for foreach() in /hermes/waloraweb086/b942/pow.scbcweb/forms/htdocs/includes/entry-functions.php on line 359

    So, for now I have removed the "review" option

    Posted 10 years ago #
  5. zforray
    Member

    I am about to upgrade to 3.5. Do I still need to modify view-functions.php with these changes? Does you changes to "Custom Form Inactive Message" address or change how this should be handled?

    Posted 10 years ago #
  6. yuniar

    I think you can simply disable the form and put a dot character or a dash into the Inactive Message. So that you won't need to modify any file.


    MachForm Founder

    Posted 10 years ago #

RSS feed for this topic

Reply