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; } })