JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" id="identificationPermanent" />
<input type="text" id="identificationValidDate" readonly />

JavaScript

// Validate "Other" textbox
var identificationPermanent = document.getElementById("identificationPermanent");
var identificationValidDate = document.getElementById("identificationValidDate");
identificationPermanent.addEventListener("click", function () {
    identificationValidDate.readOnly = identificationPermanent.checked;
});
identificationValidDate.addEventListener("focus", function (evt) {
     // Checkbox must be checked before data can be entered into textbox
    identificationValidDate.readOnly = identificationPermanent.checked;
});