php - laravel textbox disabled field mandetory -
my textbox code
<tr valign="top"> <td>{{ form::label('city', 'city:') }}</td> <td colspan="3"> {{ form::text('city', 'united states', array('class' => 'field','disabled')) }} @if($errors->first('city'))<br/><span class="error">{{ $errors->first('city') }}</span>@endif </td> </tr>
model profile.php
public static $rules = array( 'first_name' => 'required|max:32', 'city' => 'required|max:1', );
already city fields have value united states , still validation showing "the city field required." , mistake did here.. frnds..
you disabled form field on front side only!
attribute disabled
on input
element tells user cannot edit or change value.
check rules
public static $rules = array( 'first_name' => 'required|max:32', 'city' => 'required|max:1', );
you still insist city
should required. assume not pass value form validation checkpoint. check code on there.
Comments
Post a Comment