Fix javascript to call for working with form collection