I have a form with an input field and an select field.
The select field is filled with info using an xml file. This one is called “Report_Number”
The event should fire a grid.load() and then setting the value of the first cell into the input field on the form.
The event I use is myForm.attachEvent(“onChange”, function() {} );
Everything works fine but when I change the text in the input field the event is fired again and the original text is set in the inputfield.
This is indeed normal behavior because the event is for the complete form.
How can I set the event so it only works when the user change another “Report_Number” from the select field.
If possible could you explain it with an example? or refer me to an example?
Please, check the name of the changing field in your onChange event, so you will perform your custom action only for the required field:
myForm.attachEvent(“onChange”, function(name, value) {
if(name==“Report_Number”){
do_smth()
}
else
//do_nothing
} );
Only I did not use the value, what does it do?
It is not a mandatory to use the value parameter. In some cases you need to perform some special action on selecting some specific option. So you can get the value of that selecting option.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan