如何编辑复选框值?

时间:2017-10-10 10:40:43

标签: php laravel

<div class="tab-content">
<div class="tab-pane active" id="horizontal-form">
    @include('layouts.common.flash-message')
    {!! Form::open(array('url' => 'jobseekerupdate/'.$jobseekerData[0]->job_seekerid,'class'=>'form-horizontal','files'=>'true'))!!} 

         <div class="form-group">
        <label for="focusedinput" class="col-sm-2 control-label">Gender:* </label>
       <div class="col-sm-3">
            <div class="radio-inline"><label><input name="gender" type="radio" value="Male"<?php echo ($jobseekerData[0]=='Male')?'checked="checked"'  ?>> Male</label></div>
             <div class="radio-inline"><label><input name="gender" type="radio" value="Female"<?php echo ($jobseekerData[0]=='Female')?'checked="checked"'  ?>>Female</label></div>
            <div class="radio-inline"><label><input name="gender" type="radio" value="Others" <?php echo ($jobseekerData[0]=='Others')?'checked="checked"'  ?>> Others</label></div>-->
            <p><span>{{$errors->first('gender')}}</span></p>
        </div>

        <label for="focusedinput" class="col-sm-2 control-label">Marital Status:*</label>
        <div class="col-sm-4">
            <div class="radio-inline"><label><input name="marital_status" type="radio" value="Single">Single</label></div>
            <div class="radio-inline"><label><input name="marital_status" type="radio" value="Married">Married</label></div>
            <div class="radio-inline"><label><input name="marital_status"type="radio" value="Un Married">Un Married</label></div>
            <p><span>{{$errors->first('marital_status')}}</span></p>
        </div> 
    </div>

<div class="col-sm-1"></div>
    </div>
    <div class="panel-footer">
        <div class="row">
            <div class="col-sm-8 col-sm-offset-2">
                <input type="submit" class="btn-success btn" value="Submit">
                <a href="{{url('jobseekerlist')}}"> <input type="buuton" style="width: 80px;" class="btn-success btn" value="Cancel"></a>

            </div>
        </div>
    </div>
    {!! Form::close()!!}
</div>

如何编辑单选按钮值??????我的代码可能会在上述情况下显示...请为我上面的问题提供正确的解决方案???

1 个答案:

答案 0 :(得分:0)

 <div class="form-group">
        <label for="focusedinput" class="col-sm-2 control-label">Gender:* </label>
        <div class="col-sm-3">
            <div class="radio-inline"><label><input name="gender" type="radio" value="Male"<?php echo ($jobseekerData[0]->gender=='Male')?'checked':'' ?>> Male</label></div>
             <div class="radio-inline"><label><input name="gender" type="radio" value="Female"<?php echo ($jobseekerData[0]->gender=='Female')?'checked':'' ?>>Female</label></div>
            <div class="radio-inline"><label><input name="gender" type="radio" value="Others" <?php echo ($jobseekerData[0]->gender=='Others')?'checked':'' ?>> Others</label></div> 
            <p><span>{{$errors->first('gender')}}</span></p>

             </div>

        <label for="focusedinput" class="col-sm-2 control-label">Marital Status:*</label>
        <div class="col-sm-4">
            <div class="radio-inline"><label><input name="marital_status" type="radio" value="Single"<?php echo ($jobseekerData[0]->marital_status=='Single')?'checked':'' ?>>Single</label></div>
            <div class="radio-inline"><label><input name="marital_status" type="radio" value="Married"<?php echo ($jobseekerData[0]->marital_status=='Married')?'checked':'' ?>>Married</label></div>
            <div class="radio-inline"><label><input name="marital_status"type="radio" value="Un Married"<?php echo ($jobseekerData[0]->marital_status=='Un Married')?'checked':'' ?>>Un Married</label></div>
            <p><span>{{$errors->first('marital_status')}}</span></p>
        </div> 
    </div> 

上面的代码就是答案..谢谢所有人