Validate input with callback