JSFiddle - React, Tailwind, and code Playground
HTML
<form id = "query" method = "post" action = "search.php">
<input type = "checkbox" name = "col_list[]" value = "host"/>
<input type = "checkbox" name = "col_list[]" value = "atom_name"/>
<input type="text" name="order"/>
<input type = "submit"/>
</form>
JavaScript
$('[name*="col_list"]').change(function(){
console.log(this)
if ($(this).prop('checked')){
$('[name="order"]').val($('[name="order"]').val()+','+$(this).val())
}
});