Is it possible in the browser to make check of the checkbox "i agree" and prohibit sending without using JS (disabled)? For example, using CSS means to hide the Submit button, but at the same time so that the form is not submitted by pressing Enter.
You need to get a working form without JS, and not to disable sending for users with disabled JS.
<form method="POST" id="target"> <input type="text" name="phone"/> Номер телефона <br/> <input type="checkbox" name="agree" value="1" id="agree"/> Я даю согласие на обработку данных <br/> <input type="submit" value="отправить"/> </form> I will give an example of СSS code in which I don’t like that 2 submit buttons are used (this is tolerable), but the fact that sambit occurs by pressing enter in the phone field is not acceptable
<style> .btn,.btn-disabled { float:left; margin-right:5px; } .checkbox:checked~.btn-disabled { display: none; } .checkbox:not(:checked)~.btn { display: none; } </style> <form method="POST" id="target"> <input type="text" name="phone"/> Номер телефона <br/> <input type="checkbox" class="checkbox" id="agree"> Я согласен с правилами <button type="button" class="btn">Кнопка</button> <button type="button" class="btn-disabled" disabled>Кнопка</button> </form>