Php - Submitting an Array of Checkbox Values with AngularJS & Laravel 4. Checkboxes n
I am fairly new to AngularJS and am looking to integrate it into an existing Laravel 4 application (mostly for submitting/processing forms Asynchronously).
The problem I am running into, in short, is that the checkbox portion of the form is not behaving as I expected. Somehow AngularJS (I've narrowed it down to the problem happening when I encapsulate the code with the ) is making my checkboxes funky.
When I click the checkboxes they immediately "Uncheck". However, the data is passed through to my main.js on ng-submit. Somehow they are being checked... without being checked visually. Makes perfect sense right?
I've been in and out of multiple articles, so here I am :) :
The snippets below are mostly based on Scotch.io's: http://scotch.io/tutorials/javascrip...-angularjs-way
The AngularJS docs on Checkboxes: http://docs.angularjs.org/api/ng.dir...input.checkbox
and a number of Stack Overflow articles (notably this one): How can AngularJS bind to list of checkbox values?
I guess it boils down to me wanting to generate the form with PHP/Laravel/Blade and just hand off the submission action/processing to AngularJS. I know I could convert the majority of this work to AngularJS/JavaScript, but for now would prefer to stick with the PHP generated form and insert the proper AngularJS attributes throughout.
Really, it is almost working for me (The text input field is submitting and being processed as I expected).
Is there a better/simpler way for me to handle a list/array of checkbox values?
PHP Generated Form (with AngularJS attributes) -> AngularJS Magic/Submit/Functions -> PHP Process Data Return Results -> $http.success -> AngularJS Functions/$scope -> Reflect /ResultsChanges in HTML Form/Data
@{{message}}
@foreach($array_items as $item) Label Text Here! @endforeach Submit That!
Check Solution