JavaScript for dynamic form creation