Chosen Select and Input old Laravel

1455271800000 php laravel

by Start Bootstrap


Writing this Post after long time, which would help others if they use Chosen Menu

 

Here is the Link of Chosen Menu . Infact i use it for many of my projects, which is simple and free to use.

 

AFAIK You can customize this as per your need, today morning while i do some bed time programming i wanted to restore the selected items after validation, it was a form post action, What i did is simple..

 

1. Check if the old inputs were there

2. If so, then get the old inputs and iterate along to check the presence in_array

 

Here you go

@foreach($types as $type)
<option value="{{ $type->id }}"  <?php if(Input::old('type')) { if(in_array($type->id, Input::old('type'))) { echo 'selected="selected"'; } }?> > {{ $type->name }} </option>
@endforeach

 

You shall break it down to look deeper :) 


Blog Search
Tags
  • Sysaxiom (4)
  • Github (8)
  • Windows (1)
  • php (25)
  • General Tips (0)
  • GoogleMaps (2)
  • Google App Script (1)
  • Heroku (4)
  • Laravel Middleware (1)
  • xampp (1)
  • Terminal (1)
  • TechCrunch (1)
  • Ubuntu (3)
  • MySQL (2)
Side Widget
can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!