Skip to main content
MindTouch Success Center

Create a "Contact Support" form for your SAP system


This allows users to send a support request via an email to whatever endpoint you specify. To create a new contact support form go to your site, and create a new page, for this example will create the form in a new page yoursitename/$ContactSupportFormDirectory.

  1. Insert a new DekiScript block.
  2. Copy and paste in the boiler plate 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>
                         
                <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" />
                </div>
                             
                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" />              
                    </div>
                } else {
                    <input type="hidden" class="mt-email-field field" name="_email" value=(user.email) />
                }       
    
                <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>
    
              
                <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"></>
                </div>
       
                <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'});           
            </>       
        </>    
    </>
    
  3. Paste the following into a CSS block. This will hide any nonessential controls. This step is optional.
    .modified, .tags, #related, .product-menu, .article-menu, .dw-hierarchy, .breadcrumbs, div.pageinfo, div.widget, .mt-content-container.widget, div.mt-search{ 
        display: none !important; 
    }
    
  4.  This will create a basic form that will output an input element for Firstname, Lastname, Email(if user is anonymous), Subject and Description.
  5. The boiler plate also creates two required hidden fields that is used to log data. The two fields are "_search" and "_path". These are already mapped out to the correct values.
  6. The last line in the form is the template call which accepts a button parameter where you can specify the text or markup to be displayed in a button that is generated for you.
  7. You can customize the form even further by adding or removing fields that suit your needs (except for _path and _search which are required).

Form Template

The following line calls the form builder template:

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

The code takes your form that you created on the page and adds the logic necessary for the article request. You can change the name of the button by replacing FORMNAME.

 
  • Was this article helpful?