Forum Moderators: open
I am trying to make it so that the user can go back to the form relevant to that data and correct some of the fields but to do that I need to be able automatically show the proper parts of the form.
I can fill the fields correctly but just filling them won't fire events like onclick.
I am able to get which events to fire and fire them manully by calling, for example,
document.getElementById('someItemName').onclick();
but the problem is that I added the events to the fields with a general function checking for the srcElement and doing the appropriate things depending on which element was fired, such as,
var obj = event.srcElement;
if(obj.name == 'SomeName'){ doSomething}
else if......
And what happens when I try calling document.getElementById('someItemName').onclick(); is that it gives me an error because it cannot find event.srcElement.
Is there any solution to this one? How can I fire events manually (So the user doesn't have to click a checkbox, for example, which is already checked just to fire the onclick event).
Best Regards
NooK