Setup wifi access on iPhone when out of range I want to setup a wifi connection on an iPhone 6S.

I have the SSID name and WPA password.  But the wifi access point is out of range.  It is not my phone.  I want to set up the wifi name and password so that when the access point is within range in the future, it autoconnects.

When I try to add the connection it complains that it cannot connect, so it is wrong, so it won't save it.

Is there a way?  So far the only way I found is to setup a local wifi hotspot with the same name and password and connect to that.  I am not sure it works.
Perhaps you can set up a temporary access point at your present location with the same SSID and password, then connect to that?  I do not know if the iPhone is going to save some other router-specific identifying information which would prevent connection at the other location, but if you have two routers available to you where you are it would be pretty easy to test.