<form> <input type="checkbox" onclick = "txt.disabled = !this.checked" /> <input type="text" name="txt" /> </form>