{{ extends "layouts/layout.htm" }}
{{ block content_main }}
{{ var $formId = "contact"}}
{{ var $action = $wsActions.create('InquirySend') }}
<form method="POST" id="contact" action="{{= $wsViews.current.url() }}">
<input type="hidden" name="wscsrf" value="{{= $action.csrf }}">
<input type="hidden" name="wsact" value="{{= $action.id }}">
<input type="hidden" name="wstarget" value="{{= $wsViews.current.url() }}">
<input type="hidden" name="wscaptchatoken" id="recaptchaToken">
{{# Pass the form ID so the configuration can be identified #}}
<input type="hidden" name="formId" value="{{= $formId }}">
<label for="email">Email</label>
<input type="text" name="email" value="{{= $action.params.email | ifNull('') }}" class="form-control">
<label for="firstName lastName">First name / last name</label>
<input type="text" name="form.firstName" value="{{= $action.params.form.firstName | ifNull('') }}" class="form-control">
<input type="text" name="form.lastName" value="{{= $action.params.form.lastName | ifNull('') }}" class="form-control">
<label for="subject" class="col-sm-3 control-label">Text</label>
<textarea name="form.text" class="form-control">{{= $action.params.form.text | ifNull('') }}</textarea>
<button type="submit">Submit</button>
</form>
{{ /block }}
{{ if $action.success }}
{{ var $inquiry = $wsForm.load($action.successInfo.inquiryId) }}
Thank you for your inquiry.
Here is your data:
<label for="email">Email</label>
{{= $inquiry.submitter.email }}
<label for="email">IP address</label>
{{= $inquiry.submitter.ipAddress }}
<label for="email">Inquiry number</label>
{{= $inquiry.id }}
<label for="email">Form</label>
{{= $inquiry.formId }}
<label for="firstName lastName">First name / last name</label>
{{= $inquiry.form.firstName.value }}
{{= $inquiry.form.lastName.value }}
<label for="subject">Customer number</label>
{{= $inquiry.form.customerNumber.value }}
<label for="subject">Subject</label>
{{= $inquiry.form.subject.value }}
<label for="subject">Text</label>
{{= $inquiry.form.text.value }}
{{ else }}
{{ if $action.globalErrors }}
{{ foreach $err in $action.globalErrors }}
{{ if $err.text }}
{{= $err.text }}
{{ else }}
{{= $err.code }}
{{ /if }}
{{ /foreach }}
{{ /if }}
{{ if $action.errors }}
{{ foreach $err in $action.errors }}
{{ if $err.text }}
{{= $err.field }} - {{= $err.text }} - {{= $err.subCode }}
{{ else }}
{{= $err.field }} - {{= $err.code }} - {{= $err.subCode }}
{{ /if }}
{{ /foreach }}
{{ /if }}
{{ /if }}
Variables/fields
The following variables are available for this form. The values of the variables can be accessed via the.value operator.
| Variable | Function |
|---|---|
| $action.params.email | Field for the email address |
| $action.params.form.firstName | Field for the first name |
| $action.params.form.lastName | Field for the last name |
| $action.params.form.customerNumber | Field for the customer number |
| $action.params.form.subject | Field for the subject of the message |
| $action.params.form.text | Field for the message |
| $action.params.form.text.value | Text of the message |
| $inquiry.id | ID of the inquiry |
| $inquiry.formId | ID of the form |
