When you clean the carpet be sure to use an enzyme cleaner. That will get rid of all the smell (even the stuff we dont smell but they do) so that when they reach the carpet it doesn't smell like a potty. Keep a VERY CLOSE eye on them and when they start acting like they're going to potty say "uh uh, potty outside" (or something to that effect, but whatever you choose, be consistent) and take them out. When they potty outside praise like crazy. If you miss and they potty inside, no yelling, just put them in another room and clean it up. Some people have said to put the mess outside and take the dog to the mess and say something like, "potty here" but I've never tried that, but if it helps, go for it.
~Steph

"Women and cats will do as they please, and men and dogs should relax and get used to the idea." - Robert A. Heinlein