V
V
Vladimir2017-05-23 10:35:23
PHP
Vladimir, 2017-05-23 10:35:23

Why is the checkbox not working on the form?

Hello . A question. I have a Bitrix form.
There I have this line

<div><span><?=$arResult["ERROR_MESSAGE"]["ERR_CHECK"]?></span></div>
<input class="calc-form-checkbox" type="checkbox" name="check" checked = "checked">
<label class="calc-form-label">Я согласен<span>*</span></label>
<?var_dump($_POST["check"])?>

<input   type="button" name="submit" value="Отправить" />

And that's how much - then immediately he gives me a NULL value ce65315d9594465e8e6e7ceec114f4c9.jpg
If you press the submit button - send. It doesn't matter if it's checked or not, it changes me to on.
f4e43eed80364b62af9414029f72dfd2.jpg
So I can't track the isset of the button and prevent the form from being submitted if not isset

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
romy4, 2017-05-23
@romy4

> checked = "checked"
first. invalid! in html, you can’t beat off with spaces around =
although it initially perceives the word checked as checked

F
FinderOT, 2017-05-23
@FinderOT

NULL because there is no value

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question