Hello All,
we have an issue related to multiple change events on one form .facing issue while i am doing onchange on form1 form2 is getting called unnecessarily.Guys help me
Form1.attachEvent(“onChange”,function(){});
Form2.attachEvent(“onChange”,function(){});
Darya
July 2, 2013, 11:17am
#2
Hello
Try the next sample:
formData = [{
type: "settings",
position: "label-left",
labelWidth: 130,
inputWidth: 120
}, {type: "fieldset", inputWidth: 170, label: "Select 1", list:[
{type: "radio", name: "main_select", value: "red", label: "Red", checked: true},
{type: "radio", name: "main_select", value: "green", label: "Green"},
{type: "radio", name: "main_select", value: "blue", label: "Blue"}
]}];
myForm1 = new dhtmlXForm("myForm1", formData);
myForm2 = new dhtmlXForm("myForm2", formData);
myForm1.attachEvent("onChange",function(id, value, state){
console.log("form1")
});
myForm2.attachEvent("onChange",function(id, value, state){
console.log("form2")
});
It shows correctly
What is your issue? May be you haven’t put the parameters?