Forum

Thread tagged as: Problem, Runway, Forms

Form success field not showing in admin

Have added Forms app to Runway.

Have successfully added basic contact form which submits fine. This uses contact.html template in in templates/forms.

However I do not see the Thank you message textarea as a region in admin area. If I add text in the perch:success tag itself in the html template I get that echoed on page when form submits.

<perch:success>
        <perch:content id="success" type="textarea" label="Thank you message" textile="true" editor="markitup" show-form="true" />
Success!
    </perch:success>

How do I get the Thank you message textarea to show as editable region in admin?


<perch:form id="contact" method="post" app="perch_forms"> <div class="form-group"> <perch:content id="intro" type="textarea" label="Intro" textile="true" editor="markitup" size="m" class="form-control" /> <div> <perch:label for="name">Name</perch:label> <perch:input type="text" id="name" required="true" label="Name" class="form-control" /> <perch:error for="name" type="required">Please add your name</perch:error> </div> <div> <perch:label for="email">Email</perch:label> <perch:input type="email" id="email" required="true" label="Email" placeholder="you@company.com" class="form-control" /> <perch:error for="email" type="required">Please add your email address</perch:error> <perch:error for="email" type="format">Please check your email address</perch:error> </div> <div> <perch:label for="message">Message</perch:label> <perch:input type="textarea" id="message" required="true" label="Message" class="form-control" /> <perch:error for="message" type="required">Please add a message</perch:error> </div> <div> <perch:input type="submit" id="submit" value="Send" class="btn btn-primary" /> </div> <perch:success> <perch:content id="success" type="textarea" label="Thank you message" textile="true" editor="markitup" show-form="true" />Success! </perch:success> </div> </perch:form>

Debug Message [24] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM sqhc_pages p LEFT JOIN sqhc_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC, p.pagePath ASC Matched page: /contact, so not using routes. Using master page: /templates/pages/contact.php [1] SELECT * FROM sqhc_pages WHERE pagePath='/contact' LIMIT 1 Using template: /templates/pages/attributes/default.html Using sub-template: /templates/pages/attributes/seo.html [10] SELECT * FROM sqhc_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC [1] SELECT pageTreePosition FROM sqhc_pages WHERE pagePath='/contact' LIMIT 1 [1] SELECT pageID FROM sqhc_pages WHERE pageTreePosition IN ('000-011', '000') ORDER BY pageTreePosition DESC Using template: /templates/navigation/item.html [4] Using template: /templates/navigation/item2.html [4] Using template: /templates/navigation/item2.html [3] SELECT regionKey, regionHTML FROM sqhc_content_regions WHERE regionPage='/contact' OR regionPage='*' ORDER BY regionPage DESC [24] SELECT DISTINCT settingID, settingValue FROM sqhc_settings WHERE userID=0 Using template: /templates/forms/contact.html [1] SELECT groupID FROM sqhc_navigation WHERE groupSlug='footer-nav' LIMIT 1 [3] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM sqhc_navigation_pages np, sqhc_pages p WHERE p.pageID=np.pageID AND np.groupID=3 AND p.pageNew=0 ORDER BY np.pageTreePosition ASC [0] SELECT np.pageTreePosition FROM sqhc_pages p, sqhc_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=3 AND p.pagePath='/contact' LIMIT 1 [3] Using template: /templates/navigation/footer-item.html [1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM sqhc_pages WHERE pagePath='/contact' OR pageSortPath='/contact' LIMIT 1 [1] SELECT * FROM sqhc_pages WHERE pageID=0 LIMIT 1 [4] SELECT * FROM sqhc_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC [1] SELECT pageTreePosition FROM sqhc_pages WHERE pagePath='/contact' LIMIT 1 [1] SELECT pageID FROM sqhc_pages WHERE pageTreePosition IN ('000-011', '000') ORDER BY pageTreePosition DESC Request time: 0.1139 Process time: 0.1117 Memory: 4.8805

Thanks Keith

Keith Winter

Keith Winter 0 points

  • 4 years ago

I have another question too which may be related in some way. I want to create a collection for my Forms but when I try and assign a template to the collection it does not show my form templates which are in templates/forms. I can only see html templates in templates/ No access to subfolders inside templates/

When I moved my contact form html template out of templates/forms into /templates the perch form tag didn't find the template.

Can form templates exist anywhere in templates/ or do they have to be in templates/forms ?

Thanks

Simon Clay

Simon Clay 127 points

Hi Keith,

To allow the 'Success message' to be editable, you would need to have the template in templates/content rather than templates/forms. Also to show the form on your page, you'll need to use perch_content rather than perch_forms

eg

<?php perch_content('Contact Form'); ?>

Rather than

<?php perch_form('contact.html'); ?>

Ah ok understand, will give that a try. Will the form still function in same way if used with perch_content? Thanks

Thanks works a treat! K

Simon Clay

Simon Clay 127 points

Hi, yes it will. But remember, if you now make an alteration to the from template, you need to go to the Region in Admin and click save.

Yep, getting used to how Perch works now with template changes. Thanks again.