Forum

Thread tagged as: Question, Problem, Members

Editable Content in Member Forms

Hi, I've been struggling to get a member form up with a editable content region. I'm calling this in my page:

perch_member_form('register.html');

but the region does't come up. When I use:

perch_content('register');

The form does not submit to the members app.

Here's a copy of my form:

<perch:form id="register" method="post" app="perch_members" type="customer">

    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 ">
            <h2><perch:content id="heading" type="text" label="Heading" required="true" /></h2>
            <perch:content id="intro" type="textarea" label="Introductary Text" textile="true" html="true" editor="ckeditor" />
        </div>
        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-4 pull-right text-center">
            <img src="<perch:content id="register_meter" type="image" label="Logo" />" alt="<perch:content id="register_meter_alt" type="text" label="Alt text" />" />
        </div>  
        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-4 pull-left">

            <perch:label for="firstname">First Name</perch:label>
            <div class="input-group">
              <div class="input-group-addon"><i class="fa fa-user"></i></div>
                <perch:input type="text" class="form-control" id="firstname" name="firstname" required="true" label="First Name" />
            </div>
            <perch:error for="firstname" type="required">
                <div class="text-danger help-block">Please enter your first name</div>
            </perch:error>

            <perch:label for="surname">Surname Name</perch:label>
            <div class="input-group">
              <div class="input-group-addon"><i class="fa fa-user"></i></div>
                <perch:input type="text" class="form-control" id="surname" name="surname" required="true" label="Surname" />
            </div>
            <perch:error for="surname" type="required">
                <div class="text-danger help-block">Please enter your surname</div>
            </perch:error>


            <perch:label for="email">Email Address</perch:label>
            <div class="input-group">
              <div class="input-group-addon"><i class="fa fa-envelope"></i></div>
                <perch:input type="email" class="form-control" id="email" required="true" label="Email Address" />
            </div>
            <perch:error for="email" type="required">
                <div class="text-danger help-block">Please ensure a valid Email Address</div>
            </perch:error>
            <perch:error for="email" type="format">
                <div class="text-danger help-block">Please check your email address</div>
            </perch:error>


            <perch:label for="password">Password</perch:label>
            <div class="input-group">
              <div class="input-group-addon"><i class="fa fa-key"></i></div>
                <perch:input type="password" class="form-control" id="password" required="true" match-with="password2" />
            </div>
            <perch:error for="password" type="required">
                <div class="text-danger help-block">Please add a password</div>
            </perch:error>
            <perch:error for="password" type="match">
                <div class="text-danger help-block">Passwords do not match</div>
            </perch:error>


            <perch:label for="password2">Re-enter Password</perch:label>
            <div class="input-group">
              <div class="input-group-addon"><i class="fa fa-key"></i></div>
                <perch:input type="password" class="form-control" id="password2" required="true" />
            </div>
            <perch:error for="password2" type="required">
                <div class="text-danger help-block">Please repeat your password</div>
            </perch:error>

            <hr />

            <perch:input type="cms" /><!-- needed because of submit using button not perch:input. needed for icon-->
            <button type="submit" id="submit" class="btn btn-primary form-control">Create Account <i class="fa fa-chevron-right pull-right"></i>    </button>


        </div>

    </div>
    <div class="row">   


    </div>

  <perch:success>
        <p>Thanks!</p>
    </perch:success>

</perch:form>

I'm using the latest Perch Runway. I'd really appreciate any help Thanks Dylan

Dylan Rynhart

Dylan Rynhart 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What does debug give you when the form doesn't submit?

Apologies for the delay. Here's the Debug code from the form:

Debug Message
SELECT * FROM perch2_pages WHERE pagePath='/perch/core/runway/start.php' LIMIT 1
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
SELECT * FROM perch2_members_forms WHERE formKey='register.customer' LIMIT 1
INSERT INTO perch2_members(memberAuthType,memberEmail,memberPassword,memberStatus,memberCreated,memberProperties) VALUES('native','fdfjh@fdhj.com','$P$Blw62e9EsWTj.yaOI/e4P7Ge9MV5H00','pending','2015-03-13 12:19:42','{\"first_name\":\"TEST\",\"last_name\":\"TEST\"}')
SELECT * FROM perch2_members WHERE memberID='6' LIMIT 1
Logging resources for perch_members
No ids to log.
UPDATE perch2_members SET memberAuthID='6', memberStatus='active' WHERE memberID=6
Logging resources for perch_members
No ids to log.
SELECT * FROM perch2_members_tags WHERE tag='customer' LIMIT 1
DELETE FROM perch2_members_member_tags WHERE memberID='6' AND tagID='1'
INSERT INTO perch2_members_member_tags(memberID,tagID) VALUES('6','1')
PerchMembers_Member Object
(
    [table:protected] => perch2_members
    [pk:protected] => memberID
    [static_fields] => Array
        (
            [0] => memberID
            [1] => memberAuthType
            [2] => memberAuthID
            [3] => memberEmail
            [4] => memberPassword
            [5] => memberStatus
            [6] => memberCreated
            [7] => memberExpires
            [8] => memberProperties
        )

    [field_aliases] => Array
        (
            [email] => memberEmail
            [status] => memberStatus
            [expires] => memberExpires
            [auth_id] => memberAuthID
            [id] => memberID
        )

    [api:protected] => PerchAPI Object
        (
            [app_id] => perch_members
            [version] => 1
            [Lang:PerchAPI:private] => 
        )

    [db:protected] => PerchDB_MySQL Object
        (
            [link:PerchDB_MySQL:private] => PDO Object
                (
                )

            [errored] => 
            [error_msg] => 
            [dsn] => mysql:host=localhost;dbname=tramexme_perch;
        )

    [details:protected] => Array
        (
            [memberID] => 6
            [memberAuthType] => native
            [memberAuthID] => 6
            [memberEmail] => fdfjh@fdhj.com
            [memberPassword] => $P$Blw62e9EsWTj.yaOI/e4P7Ge9MV5H00
            [memberStatus] => active
            [memberCreated] => 2015-03-13 12:19:42
            [memberExpires] => 
            [memberProperties] => {"first_name":"TEST","last_name":"TEST"}
        )

    [index_table:protected] => 
    [event_prefix:protected] => 
    [can_log_resources:protected] => 1
)
SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC
Using master page: /templates/pages/home.php
Page arguments:
SELECT * FROM perch2_pages WHERE pagePath='/' LIMIT 1
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/' LIMIT 1
SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-001', '000')
Using template: /templates/navigation/bootstrap_item_1.html
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/' LIMIT 1
SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-001', '000')
Using template: /templates/members/login/login_form.html
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/' OR regionPage='*' ORDER BY regionPage DESC
Debug Message
SELECT * FROM perch2_pages WHERE pagePath='/perch/core/runway/start.php' LIMIT 1
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
SELECT * FROM perch2_members_forms WHERE formKey='register.customer' LIMIT 1
INSERT INTO perch2_members(memberAuthType,memberEmail,memberPassword,memberStatus,memberCreated,memberProperties) VALUES('native','fdfjh@fdhj.com','$P$Blw62e9EsWTj.yaOI/e4P7Ge9MV5H00','pending','2015-03-13 12:19:42','{\"first_name\":\"TEST\",\"last_name\":\"TEST\"}')
SELECT * FROM perch2_members WHERE memberID='6' LIMIT 1
Logging resources for perch_members
No ids to log.
UPDATE perch2_members SET memberAuthID='6', memberStatus='active' WHERE memberID=6
Logging resources for perch_members
No ids to log.
SELECT * FROM perch2_members_tags WHERE tag='customer' LIMIT 1
DELETE FROM perch2_members_member_tags WHERE memberID='6' AND tagID='1'
INSERT INTO perch2_members_member_tags(memberID,tagID) VALUES('6','1')
PerchMembers_Member Object
(
    [table:protected] => perch2_members
    [pk:protected] => memberID
    [static_fields] => Array
        (
            [0] => memberID
            [1] => memberAuthType
            [2] => memberAuthID
            [3] => memberEmail
            [4] => memberPassword
            [5] => memberStatus
            [6] => memberCreated
            [7] => memberExpires
            [8] => memberProperties
        )

    [field_aliases] => Array
        (
            [email] => memberEmail
            [status] => memberStatus
            [expires] => memberExpires
            [auth_id] => memberAuthID
            [id] => memberID
        )

    [api:protected] => PerchAPI Object
        (
            [app_id] => perch_members
            [version] => 1
            [Lang:PerchAPI:private] => 
        )

    [db:protected] => PerchDB_MySQL Object
        (
            [link:PerchDB_MySQL:private] => PDO Object
                (
                )

            [errored] => 
            [error_msg] => 
            [dsn] => mysql:host=localhost;dbname=tramexme_perch;
        )

    [details:protected] => Array
        (
            [memberID] => 6
            [memberAuthType] => native
            [memberAuthID] => 6
            [memberEmail] => fdfjh@fdhj.com
            [memberPassword] => $P$Blw62e9EsWTj.yaOI/e4P7Ge9MV5H00
            [memberStatus] => active
            [memberCreated] => 2015-03-13 12:19:42
            [memberExpires] => 
            [memberProperties] => {"first_name":"TEST","last_name":"TEST"}
        )

    [index_table:protected] => 
    [event_prefix:protected] => 
    [can_log_resources:protected] => 1
)
SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC
Using master page: /templates/pages/home.php
Page arguments:
SELECT * FROM perch2_pages WHERE pagePath='/' LIMIT 1
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/' LIMIT 1
SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-001', '000')
Using template: /templates/navigation/bootstrap_item_1.html
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/' LIMIT 1
SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-001', '000')
Using template: /templates/members/login/login_form.html
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/' OR regionPage='*' ORDER BY regionPage DESC
Time: 0.1108
Memory: 4.3752
Drew McLellan

Drew McLellan 2638 points
Perch Support

That submission is being handled by the Members app.

Yes, but there must be some error as it's not registering the entry in the members app ?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It should be under the 'Pending' tab.

Unfortunately there's nothing under pending ?

Sorry, to be clear, the form submits and I get the thank you message on the page, but no entry appears in the members app. When I use the

perch_member_form('register.html');

It submits perfectly, but I can't edit the content regions in the page. I'd like to be able to use

perch_content('register');

and select the form template (like the forms app) and edit regions in the form, and have the member come up in the members app. I'm sure this is clear, It just helps me to sum up. Are you able to get this working ? Thanks Dylan

Drew McLellan

Drew McLellan 2638 points
Perch Support

I can see it working in the debug:

INSERT INTO perch2_members(memberAuthType,memberEmail,memberPassword,memberStatus,memberCreated,memberProperties) VALUES('native','fdfjh@fdhj.com','$P$Blw62e9EsWTj.yaOI/e4P7Ge9MV5H00','pending','2015-03-13 12:19:42','{\"first_name\":\"TEST\",\"last_name\":\"TEST\"}')

Is your perch2_members table empty?

Drew, I'm sorry, I've discovered the problem was with my test environment, I've restarted the server and it's working perfectly now. So sorry to waste your time ! Thanks Dylan