You need to switch your ipad into recover mode by:
First you need to connect your ipad to your mac computer.
Then hold the home button and the power button to switch off the ipad.
Keep holding till you see the white Apple logo show on the middle of the screen.
Then keep holding the home button but release the power button.
Then keep holding the home button till you can see the screen show up a image to ask you to connect to itune.
Then you can release the home button.
Then open your itune on your computer.
Then your itunes will ask you to restore or update.
After you restore the device, then you still need the old apple id to unlock the device,: