$(document).ready(function(){
$("select.SubGroup").change(function(){
var selectedGroupe = $(".SubGroup option:selected").val();
$.post('/app/addons/ct_mailchimp/controllers/ct_mailchimp.php', {"locationID": selectedGroupe},
function (selectedGroupe) {
alert(selectedGroupe);
});
});
});
<select class="SubGroup" id="SubGroupUniqueId">
{foreach from = $ct_get_subusergroupsTest item=subgroup}
<option value ="{$subgroup.name}">
{$subgroup.name}
</option>
{/foreach}
</select>
JChkb2N1bWVudCkucmVhZHkoZnVuY3Rpb24oKXsKICAgICQoInNlbGVjdC5TdWJHcm91cCIpLmNoYW5nZShmdW5jdGlvbigpewogICAgdmFyIHNlbGVjdGVkR3JvdXBlID0gJCgiLlN1Ykdyb3VwIG9wdGlvbjpzZWxlY3RlZCIpLnZhbCgpOwogICAgJC5wb3N0KCcvYXBwL2FkZG9ucy9jdF9tYWlsY2hpbXAvY29udHJvbGxlcnMvY3RfbWFpbGNoaW1wLnBocCcsIHsibG9jYXRpb25JRCI6IHNlbGVjdGVkR3JvdXBlfSwKICAgIGZ1bmN0aW9uIChzZWxlY3RlZEdyb3VwZSkgewogICAgICAgIGFsZXJ0KHNlbGVjdGVkR3JvdXBlKTsKICAgICAgIH0pOwogICAgfSk7Cn0pOwoKCgo8c2VsZWN0IGNsYXNzPSJTdWJHcm91cCIgaWQ9IlN1Ykdyb3VwVW5pcXVlSWQiPgogICAge2ZvcmVhY2ggZnJvbSA9ICRjdF9nZXRfc3VidXNlcmdyb3Vwc1Rlc3QgaXRlbT1zdWJncm91cH0KICAgIDxvcHRpb24gdmFsdWUgPSJ7JHN1Ymdyb3VwLm5hbWV9Ij4KICAgIHskc3ViZ3JvdXAubmFtZX0KPC9vcHRpb24+CnsvZm9yZWFjaH0KPC9zZWxlY3Q+
js: "prog.js", line 14: syntax error
js: {foreach from = $ct_get_subusergroupsTest item=subgroup}
js: .................^
js: "prog.js", line 15: missing ; before statement
js: <option value ="{$subgroup.name}">
js: .................^
js: "prog.js", line 16: syntax error
js: {$subgroup.name}
js: ...................^
js: "prog.js", line 17: unterminated regular expression literal
js: </option>
js: ........^
js: "prog.js", line 18: unterminated regular expression literal
js: {/foreach}
js: .........^
js: "prog.js", line 19: unterminated regular expression literal
js: </select>
js: ........^
js: "prog.js", line 1: Compilation produced 6 syntax errors.