vendredi 29 septembre 2017

Select element not displaying Laravel vaildation errors

i never had this problem before i have a select element with option and in my controller i set it to required and for some reason the validation error does not display the has error class doesn't even get added to the form-group

html and blade

<div class="form-group ">
       <label for="Return_Type">Return Type <span class="request-alert"></span></label>
         <select name="Test" id="Return_Type" class="form-control">
              <option>Choose One...</option>
                  @foreach($categories as $category)
                     <option value=""></option>
                  @endforeach
          </select>
          @if($errors->has('Test'))
             <span class="help-block">
                  
             </span>
           @endif
</div>

controller

 $this->validate($request, [
            'First_Name'    => 'required',
            'Last_Name'     => 'required',
            'Email'         => 'required',
            'Phone'         => 'required',
            'Fax'                        ,
            'Company'                    ,
            'Marketplace'   => 'required',
            'Order_Number'  => 'required',
            'Address_1'     => 'required',
            'Address_2'                  ,
            'City'          => 'required',
            'State'         => 'required',
            'Zip_Code'      => 'required',
            'Test'          => 'required',
            'Product_Name'  => 'required',
            'Quantity'      => 'required',
            'SKU'           => 'required',
        ]);



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2wpnio6
via IFTTT

Aucun commentaire:

Enregistrer un commentaire