<commit_before># Laravel-Bootstrap-Modal-Form

A form validation extension for your Laravel app.  Use when embedding a [Bootstrap form](http://getbootstrap.com/css/#forms) into a [Bootstrap/jQuery modal](http://getbootstrap.com/javascript/#modals).  This script keeps modal open, submits form via AJAX, queries your [Laravel validation](http://laravel.com/docs/validation) rules, and populates error messages.

![Demo](http://zippy.gfycat.com/DefensiveFlickeringKilldeer.gif)

# Requirements

- [Bootstrap CSS](http://getbootstrap.com/css/)
- [Bootstrap JS](http://getbootstrap.com/javascript/)
- [jQuery](http://jquery.com) (Bootstrap JS also depends on it.)

# Quick Installation

Via [Bower](http://bower.io):
```
bower install jerseymilker/laravel-bootstrap-modal-form --save
```

# Basic Usage

- Embed [Bootstrap form](http://getbootstrap.com/css/#forms) into [Bootstrap/jQuery modal](http://getbootstrap.com/javascript/#modals).
- Setup [Laravel validation](http://laravel.com/docs/validation).
- Include this script.
- Add `class="bootstrap-modal-form"` to form.
- Add `class="bootstrap-modal-form-open"` to modal open button.

# Shameless Plug

I highly recommend [BootForms](http://github.com/adamwathan/bootforms) form builder package by [<NAME>](https://twitter.com/adamwathan).  This is a great helper which makes generating Bootstrap form markup super easy.  It even auto-detects Laravel's validation state and outputs error messages for most field types.  Example usage...

This...
```php
{!! BootForm::text('First Name', 'first_name') !!}
```
Generates this...
```php
<div class="form-group {!! $errors->has('first_name') ? 'has-error' : '' !!}">
  <label for="first_name">First Name</label>
  <input type="text" class="form-control" id="first_name">
  {!! $errors->first('first_name', '<p class="help-block">:message</p>') !!}<commit_msg>Adding additional notes.<commit_after># Laravel-Bootstrap-Modal-Form

A form validation extension for your Laravel app.  Use when embedding a [Bootstrap form](http://getbootstrap.com/css/#forms) into a [Bootstrap/jQuery modal](http://getbootstrap.com/javascript/#modals).  This script keeps modal open, submits form via AJAX, queries your [Laravel validation](http://laravel.com/docs/validation) rules, and populates error messages.

![Demo](http://zippy.gfycat.com/DefensiveFlickeringKilldeer.gif)

# Requirements

- [Bootstrap CSS](http://getbootstrap.com/css/)
- [Bootstrap JS](http://getbootstrap.com/javascript/)
- [jQuery](http://jquery.com)

# Quick Installation

Via [Bower](http://bower.io):
```
bower install jerseymilker/laravel-bootstrap-modal-form --save
```

# Basic Usage

- Embed [Bootstrap form](http://getbootstrap.com/css/#forms) into [Bootstrap/jQuery modal](http://getbootstrap.com/javascript/#modals).
- Setup [Laravel validation](http://laravel.com/docs/validation).
- Include this script.
- Add `class="bootstrap-modal-form"` to form.
- Add `class="bootstrap-modal-form-open"` to modal open button.

# Additional Notes

- This script does not handle CSRF tokens. Use Laravel's [_token field](http://laravel.com/docs/5.0/routing#csrf-protection) in your forms if needed.
- This script submits via `POST` form action. Use Laravel's [method spoofing](http://laravel.com/docs/5.0/routing#method-spoofing) if you need to submit via `PUT`, `PATCH`, or `DELETE`.

# Shameless Plug

I highly recommend [BootForms](http://github.com/adamwathan/bootforms) form builder package by [<NAME>](https://twitter.com/adamwathan).  This is a great helper which makes generating Bootstrap form markup super easy.  It even auto-detects Laravel's validation state and outputs error messages for most field types.  Example usage...

This...
```php
{!! BootForm::text('<NAME>', 'first_name') !!}
```
Generates this...
```php
<div class="form-group {!! $errors->has('first_name') ? 'has-error' : '' !!}">
  <label for="first_name"><NAME></label>
  <input type="text" class="form-control" id="first_name">
  {!! $errors->first('first_name', '<p class="help-block">:message</p>') !!}
{'fraction_non_alphanumeric': 0.16381660470879802, 'fraction_numerical': 0.0009913258983890955, 'mean_word_length': 5.014903129657228, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '431958', 'n_tokens_mistral': 1279, 'n_tokens_neox': 1232, 'n_words': 323}