Hi, I'm trying add onChange event for the radio buttons in the GM_config.init. This loop add change event for all radio buttons with name "head"+its number, but I'm geting data from the last one only. Am I doing something wrong or is it bug?
I'm dynamically generate sections with radio buttons and text fields.
Thank you.
`
'events':{
'open': function(doc) {
var myRows = GM_config.get('rows');
for (var i = 1; i <= myRows; i++){
var radioName = 'head'+i;
GM_config.fields[radioName].node.addEventListener('change', function () {
alert(radioName + " " + GM_config.get(radioName, true));
}, false);
};
}
}
Hi, I'm trying add onChange event for the radio buttons in the GM_config.init. This loop add change event for all radio buttons with name "head"+its number, but I'm geting data from the last one only. Am I doing something wrong or is it bug? I'm dynamically generate sections with radio buttons and text fields. Thank you. `
`