2016-04-05 6 views
0

enter image description hereFeld nach Überprüfung Checkbox aktivieren in yii2

I Bild und code.Here Ich möchte angeschlossen haben, nachdem geprüft Checkbox das Feld aktivieren ow es disable.Actually sein werde ich nicht in der Lage bin zu verstehen, wie id zu bekommen, Kontrollkästchen, weil in yii2 und einfachen hTML-Code ist es anders i in yii2 Format für Kontrollkästchen und anderes Feld einfachen hTML-Code verwenden ... Vielen Dank im Fortschritt

<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 form-inline" > 
      <div class="row"> 
       <div class="col-lg-4"> 
       <input type="checkbox" id="Airshipment" name="Airshipment" value="A" selected>By Air 
<!-- 
       <?=$form->field($modelAirshipment, 'air_ship_id')->checkBox(['label' => 'By Air', 'uncheck' => null, 'checked' => 'checked']); ?> 
      --> 
      </div> 
      </div> 
      <div class="row"> 
       <div class="col-lg-4"> 
        <?= $form->field($modelAirshipment, 'air_mawbno')->textInput(['maxlength' => true]) ?> 

       </div> 
       <div class="col-lg-4"> 
        <?= $form->field($modelAirshipment, 'air_pieces')->textInput(['maxlength' => true]) ?> 
       </div> 
       <div class="col-lg-4"> 
        <?= $form->field($modelAirshipment, 'air_packing_type')->dropDownList([ 'Box' => 'Box', 'Drum' => 'Drum', ], ['prompt' => '']) ?> 
       </div> 
      </div> 
</div> 
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 form-inline"> 
     <div class="row"> 
      <div class="col-lg-4"> 
      <input type="checkbox" id="Seashipment" name="Seashipment[S]" value="S" selected>By Sea 
     </div> 
     </div> 
     <div class="row"> 
      <div class="col-lg-4"> 
      <?= $form->field($modelSeashipment, 'sea_packing_type')->dropDownList([ 'Box' => 'Box', 'Drum' => 'Drum', ], ['prompt' => '']) ?> 
      </div> 
      <div class="col-lg-4"> 
      <?= $form->field($modelSeashipment, 'sea_pieces')->textInput(['maxlength' => true]) ?> 
      </div> 
      <div class="col-lg-4"> 
      <?= $form->field($modelSeashipment, 'sea_dimension')->textInput() ?> 
      </div> 
     </div> 
</div> 
+0

Ich bezweifle, brauchen machen checked 'php' in diesem Beispiel einen Teil spielt .. Bitte teilen' parsed' HTML – Rayon

+0

Ich habe Code angebracht in diesem nur Kontrollkästchen Zeile in HTML-Code –

Antwort

1

i vor, dieses Problem hätte, löse ich es von hide und show Elemente von JS-Code :)

in window.onload alle Elemente machen .hide mit Ausnahme der Kontrollkästchen, auf die Elemente, die Sie .show

Verwandte Themen