Я нашел этот пост в блоге , чтобы быть очень полезным (я не автор). Подводя итог (пожалуйста, прочитайте, хотя):
... идентификаторы с разделителями чувствительны к регистру ("table_name"! = "Table_Name"), тогда как идентификаторы без кавычек не являются и преобразуются в верхний регистр (table_name => TABLE_NAME).
blockquote>Он обнаружил, что DB2, Oracle и Interbase / Firebird совместимы на 100%:
PostgreSQL ... содержит нижний регистр каждого некотируемого идентификатора , а не верхняя часть его. MySQL ... зависит от файловой системы. SQLite и SQL Server ... случай имен таблиц и полей сохраняется при создании, но после этого они полностью игнорируются.
blockquote>
Вот несколько способов добиться этого:
var arCodes = [];
$("input[name^='violation_template_notices']")
.each(function(input) {
// collect the input values into an array
arCodes.push($(this).val());
});
// Join the values of the array and put it to the text field.
$('input[name="ar_codes"]').val(arCodes.join(','))
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<input type="hidden" id="selected_charge_code_1" value="33252" name="violation_template_notices[1][ar_code_id]">
<input type="hidden" id="selected_charge_code_2" value="33253" name="violation_template_notices[2][ar_code_id]">
<input type="hidden" id="selected_charge_code_3" value="33254" name="violation_template_notices[3][ar_code_id]">
<input type="text" name="ar_codes" value="">
const arCodes = Array.from(
$("input[name^='violation_template_notices']"),
input => input.value
).join(", ");
$('input[name="ar_codes"]').val(arCodes);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<input type="hidden" id="selected_charge_code_1" value="33252" name="violation_template_notices[1][ar_code_id]">
<input type="hidden" id="selected_charge_code_2" value="33253" name="violation_template_notices[2][ar_code_id]">
<input type="hidden" id="selected_charge_code_3" value="33254" name="violation_template_notices[3][ar_code_id]">
<input type="text" name="ar_codes" value="">