Hi Mohammad,
As far as I can see by your code, where have you defined the variable oForm. You need to define the form unique id first. The error is caused because you have used oForm before initializing it.
Hope it is helpful.
Thanks & Regards
Ankit Chauhan