working on the dynamic form in javascript