FormsBootstrap

A Laravel library to generate forms based on Laravel Collective Forms & HTML, Boostrap 5 CSS Framework, RichText editor, and Icons provided by FontAwesome. Current version: 1.0.8. Project on GitHub. Project on Packagist. Manages also results inputs of packages DateRangePickerHelper, Uploader, and Tags input. Includes form management and validation. This demosite sources available here.

Form


{!! Form::bsOpen([
  'id' => 'form_form', //form id
  'action' => route('formsbootstrap_processform') //url where form is submitted to
]) !!}
<div class="col-auto">
{!! Form::bsSubmit([]) !!}
{!! Form::bsButton(['id' => 'cancel', 'action' => 'alert("cancel clicked");', 'label' => 'Cancel']) !!}
</div>
{!! Form::bsClose() !!}
<div class="col-auto">

Output:
<form
id="form_form"
novalidate="novalidate"
action="http://sebastien.lhaire.org/formsbootstrap/processform"
method="post"
>
<input type="hidden" id="_token" name="_token" value="TiryZIxsYDrOBmC7vjyOwMOk0VSPwyMyrbwP33B6" />
<script>
jQuery(document).ready(function() {
jQuery('#form_form').sebFormHelper({
validate : true,
checkonleave : true,
ajaxcallback : null,
filldatacallback : null,
requiredclass : 'verify',
requiredcheckclass : 'verify-check',
selcheckclass : 'selcheck',
requiredspecialclass : 'verify-special',
verifymailclass : 'verify-email',
verifypassclass : 'verify-pass',
verifypassmatchclass : 'verify-pass-match',
verifypassold : 'verify-pass-old',
resettextclass : 'resettext',
resetselectclass : 'resetselect',
resetcheckclass : 'resetcheck',
resetradioclass : 'resetradio',
csrfrefreshroute : null,
data_build_function : null,
remove_validation_function : null,
clearonclick_function : null,
validate_function : null,
clear_function : null,
csrf : 'TiryZIxsYDrOBmC7vjyOwMOk0VSPwyMyrbwP33B6',
check_modified_on_reset : true,
modified_on_reset_confirm_text : 'This form has been modified. Are you sure you want to reset it ?'
});
});
</script>
<div class="col-auto">
<input id="submit" class="btn btn-primary" type="submit" value="Send">
<button id="cancel" class="btn btn-secondary" type="button">Cancel</button>
</div>
</form>

NB: some attributes are automaticallly added to tag and hidden input with CSRF token is generated.