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