Adding JavaScript form handler.