You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way that I can check an entered prompt before accepting it and if it does not fit ask the user to enter something else? For example I am using the prompt to have a restaurant server enter food items that have been ordered. I want to check the entered prompt to make sure what has been entered is on the current menu. I'm picturing this similar to when an entered prompt does not fit a specified pattern. Thank you in advance for your help!
The text was updated successfully, but these errors were encountered:
I know you can use a regex, but that would probably not be the solution you are looking for. I would be nice if we could have a validation function that would reprompt the user if it doesn't fit certain criteria defined by that function. Like if I want a number that is a multiple of 3, I don't want to create a regex to test if the number is a multiple of three, I could just use a validation function reprompts the user if result % 3 !== 0
Is there a way that I can check an entered prompt before accepting it and if it does not fit ask the user to enter something else? For example I am using the prompt to have a restaurant server enter food items that have been ordered. I want to check the entered prompt to make sure what has been entered is on the current menu. I'm picturing this similar to when an entered prompt does not fit a specified pattern. Thank you in advance for your help!
The text was updated successfully, but these errors were encountered: