You can set airplane mode automatically when you are connected to WIFI on you favorite Android (4.2+) phone provided you have:
1. 4.2+ Android Phone
2. Root Access
General instructions here:
This is not for novice users. Gaining root access and using Tasker/Secure Settings is not an easy path.