Good evening. There is a form and js, I can not understand why .serializeArray () does not work. In the console, displays [] (the topics raised here are re-read, experimented, but nothing helped).
<form class="form-horizontal" id="objectInfo"> <div class="form-group"> <label for="name" class="col-sm-2 control-label">Наименование*</label> <div class="col-sm-10"> <input type="text" class="form-control" id="name" required value="Все пользователи"> </div> </div> <div class="form-group"> <label for="active" class="col-sm-2 control-label">Состояние*</label> <div class="col-sm-10"> <input type="text" class="form-control" id="active" required value="True"> </div> </div> <div class="col-sm-10" style="text-align: center;"> <button type="submit" id="submitObjectButton" class="btn btn-primary objectButton">Сохранить</button> </div> </form> <script> $(document).ready(function(){ // submit button $('#objectInfo').submit(function (e) { var result = { }; var arr = $('#objectInfo').serializeArray(); console.log(arr); $.each($('#objectInfo').serializeArray(), function() { console.log(this.name); console.log(this.value); result[this.name] = this.value; }); e.preventDefault(); }); }); </script>