While I would generally agree wih carolegirl, within the last 5 years or so, some dwarf varities that only reach a length of about 10 to 12 inches have made their appearance and are quite nice in hanging basket due to their multi-colors and fragrance. A neighbor did this last season with good results...
Yes, If you visit a garden centre that stocks a good selection of seeds, you should find several dwarf varieties are now available. l(athyrus odoratus is the latin name) Two good drarf forms are "snoopea" 12 - 16 inches and "little sweetheart" grows only 7 inches. Both perfect for hanging baskets!!
Unless you can get the dwaft varieties I'd give them a miss this year, especially if you're in an area where a hosepipe ban applies as even the dwarf varieties needl need plenty of water to keep them flowering. However you can now buy water retention crystals in packets from garden centres which you can mix with the compost in your hanging baskets to retain moisture and reduce the amount of watering required.