more than 2 dropdown
Hello,
I'm using fabrik 1.0.6 on joomla 1.0.15
I try to use this code to make cascading dropdown.
It's good for the first dropdown which change the second dropdown.
But when i try to put the "onchange" script on the second, to change a third dropdown the "onchange" don't work because i think the second dropdown has been recreate by this code:
I dont understand all this code, but i hope this is possible to add the onchange function when it rewrite the dropdown.
Someone else ask for this, but without more info in the thread here
Thank in advance for help and sorry for my english, i'm french...!
Hello,
I'm using fabrik 1.0.6 on joomla 1.0.15
I try to use this code to make cascading dropdown.
It's good for the first dropdown which change the second dropdown.
But when i try to put the "onchange" script on the second, to change a third dropdown the "onchange" don't work because i think the second dropdown has been recreate by this code:
Code:
new Ajax(url, {
method: 'get',
onComplete: function(response) {
var newelement = new Element(
'select',
{
'id': dropdown,
'class': 'inputbox',
'name': dropdown
}
);
$(dropdown).replaceWith(newelement);
var newopts = response.split('\n');
var newopt = new Element('option',{'value': 0}).setHTML(please_select);
newopt.inject($(dropdown));
for (i=0; i<newopts.length; i++) {
if (newopts[i] != '') {
var vals = newopts[i].split('//..*..//');
var newopt = new Element(
'option',
{
'value': vals[0]
}
).setHTML(vals[1]);
newopt.inject($(dropdown));
}
}
}
Someone else ask for this, but without more info in the thread here
Thank in advance for help and sorry for my english, i'm french...!