How to set result page based on condition from user input