refactor form build

Refactored form to build with jquery instead of one long string.