The form builder has a bug, it's initialize is called twice so we need to find a better place to put the <script... adding code.
Fixed missing 'end' tag from hasty morning commit.