If you have synced your iPad with iTunes before you forget your password, you can reset your iPad by using iTunes without losing data. Through iTunes, you can restore your iPad from the last backup and remove the passcode from your locked tablet while retaining your data. If iTunes asks you to enter the passcode, try another computer. Otherwise, you have to follow the reset iPad Passcode with Recovery Mode section below.
Step 1. Connect your iPad to the computer with via a USB cable that your iPad has trusted.
Step 2. Launch iTunes. If you've synced your iPad with iTunes, then no "enter password" is required.
Step 3. iTunes will automatically sync your iPad and create a backup file. If it doesn't, you should sync your iTunes and create a backup file manually by in the Summary window.
Step 4. In the Summary window, you can see the option "Restore iPhone". Click it and follow prompts to choose the latest iTunes backup to restore your iPhone.
After the restoration process is complete, your passcode will be erased and all your data will be restored from your backup. You will now be able to access your iPad without any passcode. And you can set your new password on iPad.