Laravel 4 - Assign OnChange to Form::select
ajax, laravel-4, php
Solution
Managed to fix it guys.
{{ Form::select('name', $options, 'default', array('id' => 'some-id'); }}
Then just the ID to assign the onChange event in your JS:
$(function(){
$('some-id').change(function(e) {
//perform AJAX call
});
});
Problem
Is there a way of assigning an OnChange event to a Form::Select field? I've managed to get around it at the moment but it's very messy and I'd like to change it so all my ajax requests are within one file... Anyone else come across this? Thanks.