logic for onclick methods for buttons and query database for password