0

In the 'member area' I have the ability for a user to delete their own user account, with a confirm password field. Still, I would like to add an 'Are you sure?' Checkbox that is required. Even better would be to have the user redirected to a confirmation page with an 'Are you sure?' button. How would I accomplish this.

If I add rules:name_of_checkbox="required" to {exp:zoo_visitor:delete_form} it does not work.

0

I have created the following template that works perfectly using the stash plugin.

<!-- Delete -->
{if segment_3 == 'delete' AND !segment_4 AND "{exp:stash:get name='password' dynamic='yes'}" == '' AND "{exp:stash:get name='confirm_delete' dynamic='yes'}" == ''}

    <form action="" method="post" class="form-horizontal">
        <input type="hidden" name="csrf_token" value="{csrf_token}">
        <input type="password" class="form-control" id="password" name="password" placeholder="Password">
        <input type='checkbox' name='confirm_delete' value='yes'>Are you shure?
    </form>

{if:elseif segment_3 == 'delete' AND !segment_4 AND "{exp:stash:get name='password' dynamic='yes'}" AND "{exp:stash:get name='confirm_delete' dynamic='yes'}" == 'yes'}

    {exp:zoo_visitor:delete_form
        return='/'
        role="form"
        include_jquery='no'
        datepicker='no'
        include_assets='no'
        secure_action='yes'
        secure_return='yes'
        require_password='yes'
    }
    <input type="hidden" name="password" value="{exp:stash:get name='password' scope='user'}">
    <button type="submit" class="btn btn-default" data-loading-text="Deleting Account...">Yes</button>
    {/exp:zoo_visitor:delete_form}

{if:else}

    {redirect='/account/edit/delete'}

{/if}
<!-- ./Delete -->
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.