Answer the question
In order to leave comments, you need to log in
How to check if the checkbox is selected in Modx revo?
Good afternoon, how to check if the checkbox is selected in Modx revo?
Answer the question
In order to leave comments, you need to log in
If the checkbox is required, just specify required, for example
<input type="checkbox" name="agree[]" value="1" required >
and all)
I know how to check on js
How to check in ModX Revo - no, you haven't heard of it...
)
)
- drakosha.shop/opt
Here is an example for Formit
<div class="form-group">
<input type="hidden" name="agree[]" value="" />
<input type="checkbox" name="agree[]" value="1" class="" > <span class="mf-req">*</span>
<small>Отправляя сообщение, я принимаю <a href="terms/">пользовательское соглашение</a> и подтверждаю, что ознакомлен и согласен с <a href="privacy/">политикой конфиденциальности</a> данного сайта</small>
<br><span class="error_agree error"></span>
</div>
{$_modx->runSnippet('!AjaxForm', [
'snippet' => 'FormIt',
'hooks' => 'spam,email',
'validate' => 'agree:required',
])}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question