how to submit a form by js onclick event? I'm using Laravel 4.1.
I tried this code
@foreach ($items as $item)
<li>
{{ Form::checkbox('items', $item->id , $item->done, ['onClick'=> 'this.form.submit()']) }}
{{ $item->name }}
</li>
@endforeach
but I can't get what I want. at the controller I have the following code:
public function postIndex()
{
$id = Input::get('id');
echo $id;
}
by the way, in chrome console I got the following error:
Uncaught TypeError: Cannot read property 'submit' of null
Can anybody help me with this?
form?