Implement validation function for general pages