I"m now on my third keyboard using this method: I use 3M foam tape to attach a very thin steel plate, about 4x5 inches, to my plastic-bodied keyboard top. I have an old speaker magnet that attaches with magnetism to the bottom of my steel-bodied Yamaha mixer, and it then sticks to the metal plate on the keyboard. I did try Velcro tape, put it was too hard to remove or peeled off. For an iPad, I would stick another thin steel plate to the back of its case with 3M tape.
People warned me about the magnetics affecting the electronics, but nothing has changed. There may be an issue with the iPad"s auto-off feature that relies on a magnet in the case flap, though.