Week 11: Lab #22
Restructuring Data
DUE: Tuesday, 4/4 @ 5pm
Stripping and Reformatting Phone Numbers
- Create a form with a text field that is labeled "phonenumber".
- When the field's content changes, strip out common phone formatting characters:
- Parenthesis: ( and ).
- Dashes: -.
- Whitespace: " ".
- Replace them with nothing (empty quotes with no space).
- Verify that what is left is exactly 10 characters.
- Update the content of the field with the new string.
- When the submit button is pressed, make an alert with the reformatted number in (123) 456-7890 formatting.
Upload your completed lab by the due date specified above and make sure that you add a working link to it on your class page, otherwise it will not be reviewed and you will not receive credit.