Welcome,
First, Windows 7 comes on DVD-ROM and not CD. When you hit F12 no boot menu comes up? Or you get to the boot menu and it still won't boot from DVD?
The best known way is to use the boot menu and launch from DVD. You should check both the DVD disc itself and the DVD-ROM drive to determine if there is a problem detecting the disc. Also, check and see if you can see the disc and its files from your existing Windows 7 installation.
Check for scratches on the disc.
If none exist, you may want to call either your computer manufacturer or Microsoft Support and see if they would provide you with a replacement disc using your product key.
Your message reads difficult: At one point you apparently have Windows 7 working, yet at another juncture it doesn't work after apparently booting from the disc and formatting the drive? When you receive your installation media, you are responsible for making a backup. Doing regularly scheduled image backups of a working installation is also recommended. If the installation disc is corrupt, your only alternative is to try to get a replacement from your system manufacturer or Microsoft. You may have to pay charges for replacement media.
Some systems have complete rescue partitions which allow you to restore to factory defaults on them already, but if you do not see the option off-hand, its likely you do not have it.