JS for dynamic tags in forms