Hi,
I've added this piece of code in a x.js file in order to add a group by js but I've got an issue.
here is the code
and here is the issue
Uncaught TypeError: Cannot call method 'getElement' of undefined
This issue comes form the line 5
cheers
I've added this piece of code in a x.js file in order to add a group by js but I've got an issue.
here is the code
Code:
function addGroup(formRef,groupId,repeatNum){
var form = Fabrik.blocks[formRef];
// Create mock event
var btn = form.getElement('#group' + groupId + ' .addGroup');
if (typeOf(btn) !== 'null') {
var e = new Event.Mock(btn, 'click');
// Duplicate group
for (var i = 1; i < repeatNum ; i ++) {
form.duplicateGroup(e);
}
}
}
and here is the issue
Uncaught TypeError: Cannot call method 'getElement' of undefined
This issue comes form the line 5
Code:
var btn = form.getElement('#group' + groupId + ' .addGroup');
cheers