How much light was coming through your window?
If there wasn't much light coming through then that will be the reason they've become leggy and weak. When plants aren't recieving enough light they stretch for it and just shoot up as tall as they can.

Just keep them supported and if they recieve enough light from now on they'll strengthen up and they'll be fine.