Step 1: It All Begins (and Ends) With Velcro
Materials: a small piece of self-stick Velcro, unruly lens cap and camera
Step 1: Find a small, unobtrusive area on the bottom of the camera -- clear of hinges, screws, serial numbers, etc.
Step 2: Cut Velcro to fit and stick one side to the bottom of the camera and the other side to the center of the lens cap. Wait a few minutes for the Velcro adhesive to settle and the next thing you know the days of the loose and wild lens cap will soon be over!
It may take a few days for the glue to cure completely but if a piece of Velcro does peel off at first it should still be sticky enough to pop right back on. You should not have to baby it after a couple of days and, although the adhesive is strong, I was still able to peel it off cleanly a few weeks later.
The obvious: Make sure that the placement of any Velcro and the lens cap will not obscure any moving parts, access doors and the like before committing!