Contact Form Required Fields Plugin – formEntry error Has anyone experience with the ContactFormRequiredFields plugin? It works fine until the send button is pressed. It brings up an "Undefined variable: formEntry" error. When I look into the plugin I see that "formEntry" is connected to "formId". But what goes wrong?

        ...

        $formId = craft()-&gt;request-&gt;getPost('formId');
        $formId = craft()-&gt;security-&gt;validateData($formId);

        /**
         * Get the form entry using the ID
         */
        if ($formId)
        {
            $formEntry = craft()-&gt;entries-&gt;getEntryById($formId);
        }

        ...


Stack trace:

#0  /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/etc/web/WebApp.php(693): CApplication-&gt;handleError(8, "Undefined variable: formEntry", "/var/www/vhosts/tonartmusikschule.at/httpdocs/craft/plugins/cont...", 
#1  /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/plugins/contactformrequiredfields/ContactFormRequiredFieldsPlugin.php(48): Craft\WebApp-&gt;handleError(8, "Undefined variable: formEntry", "/var/www/vhosts/tonartmusikschule.at/httpdocs/craft/plugins/cont...", 48, ...)
#2  /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/framework/base/CComponent.php(567): Craft\ContactFormRequiredFieldsPlugin-&gt;Craft\{closure}(Craft\ContactFormEvent)
#3  /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/plugins/contactform/services/ContactFormService.php(73): CComponent-&gt;raiseEvent("onbeforesend", Craft\ContactFormEvent)
#4  /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/plugins/contactform/controllers/ContactFormController.php(139): Craft\ContactFormService-&gt;onBeforeSend(Craft\ContactFormEvent)
#5  /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/framework/web/actions/CInlineAction.php(49): Craft\ContactFormController-&gt;actionSendMessage()
#6  /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/framework/web/CController.php(308): CInlineAction-&gt;runWithParams(array("p" =&gt; "anmeldung_index"))
#7  /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/framework/web/CController.php(286): CController-&gt;runAction(CInlineAction)
#8  /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/framework/web/CController.php(265): CController-&gt;runActionWithFilters(CInlineAction, array())
#9  /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/framework/web/CWebApplication.php(282): CController-&gt;run("sendMessage")
#10 /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/etc/web/WebApp.php(836): CWebApplication-&gt;runController("contactForm/sendMessage")
#11 /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/etc/web/WebApp.php(287): Craft\WebApp-&gt;_processActionRequest()
#12 /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/framework/base/CApplication.php(185): Craft\WebApp-&gt;processRequest()
#13 /var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/index.php(62): CApplication-&gt;run()
#14 /var/www/vhosts/tonartmusikschule.at/httpdocs/public/index.php(19): require_once("/var/www/vhosts/tonartmusikschule.at/httpdocs/craft/app/index.ph...")
The plugin expects the the ID of the entry you are using to build the form fields to be submitted along with the form so it is available as a request variable. 

You should include the ID of the entry you are using to build the form’s fields when you are submitting to the contactForm/sendMessage controller. For example:

{% set form = craft.entries({
    section: 'forms',
    slug: 'contact-form',
}).first() %}

&lt;form method="post" accept-charset="UTF-8"&gt;
    &lt;input type="hidden" name="action" value="contactForm/sendMessage"&gt;
    &lt;input type="hidden" name="formId" value="{{ form.id|hash }}" /&gt;
    ...
    {# Loop through the form fields here #}
    &lt;button type="submit"&gt;Send&lt;/button&gt;
&lt;/form&gt;


The code above assumes you have a section with the handle forms and the slug of the entry you want is contact-form.

If you want a more robust solution that provides the form builder and validation out of the box, you might consider checking out Freeform from Solspace.