Hi Sir or Madam,
This is called a luxating patella. Luxating patella is when the knee pops in and out of joint. The more often it pops out, the easier it will pop out in the future. The following explains this: http://www.peteducation.com/article.cfm?cls=2&cat=1569&articleid=457 http://petsurgery.com/medialpatellarluxation.html
The following site goes over the surgery to correct this. http://vetsurgerycentral.com/patella.htm
Surgery that is performed early has a higher chance of success as the more the knee pops in and out of the joint, the easier it is for it to do so. Cost for surgery varies but I've seen prices from $500-1000 per leg. It really depends on who is doing the surgery and the area you live in. Your vet should be able to get you a good estimate. The only other thing you can do is put the leg in a brace, but it won't correct the situation. You can see braces here:
There really isn't any other option for you. I recommend early fix of the situation before the joint has deteriorated. I hope this information is helpful to you.