When foam was mentioned, it had to do with dampening movement of the cabinet door, not placement or isolation of the subwoofer.
A sub is supposed to be mechanically connected to the floor or some other large mass to help dampen vibrations (sound) from coming off the cabinet walls. That's why we want it on the floor, why we use spikes when it's on carpet -- to keep it from moving.
A good answer is easier with a clear question giving the make and model of everything. "The biggest problem in communication is the illusion that it has taken place." -- G. “Bernie” Shaw