add js modeled from trial-form