Fixed issues in OnDForm.js

bug fixes