Bootstrap 3 Implementation

Created by Alison Gianotto, Modified on Fri, 5 Feb, 2021 at 2:59 PM by Alison Gianotto

Here’s some sample code we use for Bootstrap 3, for showing valid and invalid form field styles, as defined by the CSS framework:


 

GoodForms('YOUR_FORM_TOKEN', {
        debug: true, // Set to false in Production!
        onBad: function () {
          $('#inputSuccess2Status').remove();
          $('#icon_id').remove();
          $('#exampleInputEmail1').parent().removeClass('has-success').addClass('has-error');
          $('#exampleInputEmail1').after('<span id="icon_id" class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>' +
                '<span id="inpuSuccess2Status" class="sr-only">(error)</span>');
          return true;
        },
        onGood: function () {
          $('#inputSuccess2Status').remove();
          $('#icon_id').remove();
          $('#exampleInputEmail1').parent().removeClass('has-error').addClass('has-success');
          $('#exampleInputEmail1').after('<span id="icon_id" class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true">' + 
                '</span><span id="inputSuccess2Status" class="sr-only">(success)</span>');
          return true;
        }
      })


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article