jeudi 26 mars 2015

disable an input if another input is clicked or checkbox is checked

I have three sections in a form, the first one contains one input and the second contains three inputs and the third contains a checkbox. I want to



  1. disable the two sections if checkbox is checked

  2. disable the checkbox and a section if I tapped a text in the other section

  3. enable the three sections if all of them are empty


I must have only one active section everytime.


Thanks and sorry about my english





<link href="http://ift.tt/1FHelXo" rel="stylesheet"/>
<div class="row">
<div class="col-md-4">
<div class="row">
<div class="form-group col-md-12">
<label>Search Client</label>
</div>
</div>
<div class="row">
<div class="form-group col-md-12">
<div class="input-group custom-search-form margin-bottom">
<input id="client_name_search" name="client_name_search" type="text" class="form-control input-sm" placeholder="Search...">
<span class="input-group-btn">
<button class="btn btn-default btn-sm" type="button">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</div>
</div>
</div>
<div class="col-md-8">
<div class="row">
<div class="form-group col-md-12">
<label>New Client</label>
</div>
</div>
<div class="row">
<div class="form-group col-md-4">
<input type="text" class="form-control input-sm" id="FirstName" placeholder="First Name">
</div>
<div class="form-group col-md-4">
<input type="text" class="form-control input-sm" id="LastName" placeholder="Last Name">
</div>
<div class="form-group col-md-4">
<input type="email" class="form-control input-sm" id="inputEmail" placeholder="Email">

</div>
</div>
</div>
</div>

<div class="checkbox margin-bottom">
<label>
<input id="standard" type="checkbox" value="">Standard
</label>
</div>






Aucun commentaire:

Enregistrer un commentaire