I have an iPad3 and I have the same problem. The wifi is detecting the router. It's detecting 10 other routers nearby. It just can't stay connected.
For some reason, mine started working.
Try putting it to airplane mode and then turn on the wifi from there. After it started working, I took it off Airplane mode and no problems yet.
Edit: Damnit.. I spoke too soon. It worked for a good 5 minutes. It's stopped working again...