Еще другой вопрос, при нажатии на кнопку отправить получаю в консоле ошибку An invalid form control with name='sub_cat' is not focusable. Если добавить к форме "novalidate" то ошибка проподает, но reguired не срабатывает для полей
<form id="fixed-form" class="forms1" name="testForm">
<input required="" type="text" class="userName" name="userName" placeholder="Name:*">
<input required="" type="email" class="email-f" name="email" placeholder=" E-mail:*">
<input required="" type="tel" class="tel" name="tel" placeholder=" Phone:*">
<!--<input required type='text' class='number' name='number' placeholder=' : '>-->
<select name="category" id="mark" onchange="select()"><option disabled="" selected="">Select category</option><option>Accessories for the snails farm</option><option>Canned snails</option><option>Cooked snails</option><option>Dishes from snails</option><option>Frozen snails</option><option>Live snails</option><option>Other product</option><option>Snail Slime</option></select><div id="submit-ajax-cat"></div> <script>
function select() {
var x = document.getElementById("mark").value;
jQuery.ajax({
url: "/wp-admin/admin-ajax.php",
method: 'post',
data: {
action: 'ajax_get_menu_subcategories_shop',
name: x,
},
success: function (response) {
jQuery('#submit-ajax-cat').html(response);
}
});
}
</script>
<button class="submit" type="submit">Order</button><div id="submit-ajax-res"></div></form>