Fixed JS for fetching form elements. Expanded to include mutliple params