Required radio button does not validate in form, when clicked through Javascript/jQuery

I finally found one that works for me:

document.getElementById("#dealer-selection-" + elm.id).checked=true;

For some reason, this one checks the radio button visually, while also checking it as an option.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)