Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

I want to enable textbox when checkbox is checked in jquery or javascript

function cash(cash) {
  if ($(cash).is(':checked')) {
    $('#cashAmount').attr("disabled", false);
  } else {
    alert("checkbox is not checked");
  }
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="col-md-12 field-option">
  <strong>Cash</strong> <input type="checkbox" name="cash" id="cash" onclick="cash(this)">
</div>
<div class="col-md-6 col-sm-6 custom_field">
  <!-- custom_field -->
  <span><strong>Amount <i>*</i></strong></span>
  <input type="text" name="cashAmount" id="cashAmount" class="form-control" disabled>
</div>
Comment

PREVIOUS NEXT
Code Example
Javascript :: create ew angular app 
Javascript :: string to number javascript & remove text 
Javascript :: form validation jflutter 
Javascript :: ex:h2p 
Javascript :: likedislike mangodb 
Javascript :: for of exemple 
Javascript :: khai bao bien js 
Javascript :: create model Obejctid mongoose 
Javascript :: save file as get dimensions puppeteer js 
Javascript :: convert milliseconds to hours minutes seconds days javascript 
Javascript :: return a specific value filter javascript 
Javascript :: how to give id dynamically in javascript 
Javascript :: firebase js loop 
Javascript :: React Hook "useState" is called in function "cardState" which is neither a React function component or a custom React Hook function 
Javascript :: how to disable search box and placeholder by putting some conditions using js 
Javascript :: firebase is there a way to rename a document 
Javascript :: js array piush 
Javascript :: how to catch shortcut keys in jquery 
Javascript :: ameca face expression code xcode 
Javascript :: javascript get distance bwetween elements 
Javascript :: finalGrade % 5 && <38 
Javascript :: how to check if .each first element 
Javascript :: how to create image object in javascript 
Javascript :: firestore get first document in collection and delete it 
Javascript :: Set objects Relation with Strings javascript 
Javascript :: javascript change color of button onclick 
Javascript :: EventEmitter to emit a custom event 
Javascript :: Make React Tooltip work for dynamic elements 
Javascript :: npm install error `not foundram Files/nodejs/npm: 3: /mnt/c/Program Files/nodejs/npm:` 
Javascript :: check if the last character of word is "A" 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =