I have just written a JavaScript file which calculates a taxi fare based on a starting zone, an ending zone, and the length of the taxi ride. The program appears to work fine, however, I would like to be able to display some type of alert or error message though if the proper input is not typed into the prompts. For example, there are only 3 zones available in my program, zones 1,2 and 3. If someone enters a 4 in the user prompt for the zone, I would like to be able to have a message appear indicating that zone 4 is not a valid zone. OR the alert of error message can even come up after the prompts when my HTML page loads completely stating an invalid character has been entered, please refresh the page and try again or something along those lines. If anyone has any suggestions or advice it would be greatly appreciated. I don't even need for anyone to give me the exact code, but just a direction to go into so I can figure it out. Thanks in advance and have a great day.
jobojo 0 Light Poster
kburb23 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.