if the foot is damaged it can be hard to get them to attach. I had one that I was able to keep health until the foot healed and then it attached to a rock, but most of my experience with getting one with a damaged foot didn't turn out well.
have to tried placing it in a cozy little spot that it can withdraw into at night or during feeding? usually if its trying to move it means it doesn't like the lighting or its not in a spot on the live rock where it can withdraw into.
I have tried placing it all over and it just won't stay. I read that if you place it in a spot and put the fish net over it then it will stay but I haven't tried that. What do you think of this method?