Updated form handling
Added form javascript to main layout