Skip to main content

Create a generic "Submit a Ticket" form

This page applies to:MindTouch Responsive

Create a form in MindTouch that allows your users to send a support request via email to whatever endpoint you specify. 

Create your form

The following steps create a basic form that will create a form for users to input a first name, last name, email (if user is anonymous), subject and description.

  1. Navigate to your site.
  2. Create a new page (in this example, we created the form in the new page yoursitename/$ContactSupportFormDirectory).
  3. Insert a new DekiScript block.
  4. Copy and paste in the boilerplate below:
    var args = __request.args;
    <div class="mt-support-email">
        <form class="mt-support-form ui-dform-form">
            <fieldset class="ui-dform-fieldset">
                <div class="mt-field">
                    <label class="ui-dform-label" for="firstname"> "First name:" </>
                    <input class="mt-email-field field" type="text" name="firstname" maxlength="100" />
                <div class="mt-field clear">
                    <label class="ui-dform-label" for="lastname"> "Last name:" </>
                    <input class="mt-email-field field" type="text" name="lastname" maxlength="100" />
                if(user.anonymous) {
                    <div class="mt-field clear">
                        <label class="ui-dform-label" for="email"> "Email" </>
                        <span class="mt-required">'(Required)'</span>
                        <input class="mt-email-field required field" type="text" name="_email" maxlength="300" />              
                } else {
                    <input type="hidden" class="mt-email-field field" name="_email" value=( />
                <div class="mt-field clear">
                    <label class="ui-dform-label" for="subject"> "Subject" </>
                    <span class="mt-required">'(Required)'</span>
                    <input class="mt-email-field required field full" type="text" name="subject" maxlength="300" value=(#args['query'] ? args['query'] : '') />
                <div class="mt-field clear full">
                    <label class="ui-dform-label" for="description"> "Description" </>
                    <textarea class="mt-email-field field" placeholder=("Please describe your issue.") name="description"></>
                <input type="hidden" class="mt-email-field field" name="_search" value=(#args['query'] ? args['query'] : '') />                  
                <input type="hidden" class="mt-email-field field" name="_path" value=(#args['path'] ? args['path'] : '/') />
                template('MindTouch/Controls/WorkflowSubmitIssueButton', {button: 'Submit'});           
  5. The last line in the form, is the template call that accepts a button parameter where you can specify the text or markup to be displayed in a button that is generated for you.
  6. (Optional) Paste the following into a CSS block to hide any non essential controls.
    .modified, .tags, #related, .product-menu, .article-menu, .dw-hierarchy, .breadcrumbs, div.pageinfo, div.widget, .mt-content-container.widget,{ 
        display: none !important; 
  7. Further customize the form by adding or removing fields that suit your needs.

   The boilerplate creates two required hidden fields used to log data: "_search" and "_path". Both are mapped to the correct values.


Form template

The following line calls the form builder template and adds the logic necessary for support requests. Change the name of the button by replacing FORMNAME with your text. 

template('MindTouch/Controls/WorkflowSubmitIssueButton', {button: 'FORMNAME'});