Postback
Submit web form through AJAX call.
To see this example in action, check the network tab of browser console to see AJAX request sent.
View code
<form action="wb-postback-en.html" class="wb-postback" data-wb-postback="{"success":"success-message","failure":"failure-message"}">
<div class="form-content">
<div class="form-group">
<label for="firstname"><span class="field-name">First Name</span></label>
<input class="form-control" id="firstname" name="firstname" type="text" data-rule-minlength="2" />
</div>
<div class="form-group">
<label for="lastname"><span class="field-name">Last Name</span></label>
<input class="form-control" id="lastname" name="lastname" type="text" data-rule-minlength="2" />
</div>
<div class="form-group">
<label for="preferredNumber">Preferred: <span class="field-name">Phone Number</span></label>
<input class="form-control" id="preferredNumber" name="preferredNumber" type="tel" data-rule-phoneUS="true" />
</div>
<div class="form-group">
<label for="email"><span class="field-name">Email Address</span> (test@domaine)</label>
<input class="form-control" id="email" name="email" type="email" />
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
<p class="success-message hide">Thank you!</p>
<p class="failure-message hide">Something went wrong. Please submit your information via an alternative method.</p>
Report a problem on this page
- Date modified: