moved field javascript to seperate file