javascript for form creation