JSFiddle - React, Tailwind, and code Playground

by Boba Poshtar

HTML

<form>
<p><label><input type="text" placeholder="Your login" maxlength="10" minlength="4"></label></p>
<p><label><input type="password" placeholder="Password" disabled value="12345"></label></p>
<p><label>
Your birthay-date:<br>
<input type="text" placeholder="YYYY-MM-DD"></label></p>
<p><label>
Your phone:<br>
<input type="text" placeholder="(068) 123-45-67"></label></p>
<p><input type="checkbox" id="sogl"> Я погоджуюсь на обробку персональних даних</p>
<input type="submit" disabled>

</form>

JavaScript

document.getElementById('sogl').onchange = function(){
	document.querySelector('[type="submit"]').disabled = !this.checked;
}