EDIT: I am not allowed to use regular expressions for this!
I have an assignment to validate 4 different types of phone numbers through string manipulation in javascript. I must be able to print out the final phone number into a "receipt" as this is for a pizza intake form in HTML.
I have all the code working minus this validation. These are the phone number types I need to validate: 1. ddd-ddd-dddd 2. dddddddddd 3. (ddd)ddddddd 4. (ddd)ddd-dddd
I also must provide an alert if the number is not in the required formats