A project from compass uol trainee program. This was our first chalenge, within some specifications.
- Using HTML, CSS, Java Script
- Layout according to Figma (Pixel Perfect)
- Responsive Layout
- Validation of inputs with Java Script.
- User data stored in localStorage.
- Indication of the number of characters remaining in the TextArea.
- Use of TypeScript.
- Creation of a success screen, signaling that the registration was completed successfully.
Git clone.
git clone https://github.com/RebecaBaruch/Survey_Form.git
Install all development dependencies and how to run.
npm install
npm install typescript
npm start
For compiling the TypeScript.
tsc
tsc -w
You can see the running application by live server on VSCode.
This functionality was the one wich most got me pround. I used two classes for making this functionality: UserInput, for getting input values and catch errors on validation and userOutput to the success page. For validation, regex:
let nameRegex = /^(([A-Za-z]+[\-\']?)*([A-Za-z]+)?\s)+([A-Za-z]+[\-\']?)*([A-Za-z]+)?$/;
let nameResult: any = nameRegex.test(userName);
let emailRegex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
let emailResult: any = emailRegex.test(email);
let ageRegex = /^[0-9]+\.?[0-9]*$/;
let ageResult: any = ageRegex.test(age);
My function to validate the 'Next' button verifying if the select value is null only works if you click on a radio button.
I need to fix this in the future.
- HTML3
- CSS3
- JavaScript
- TypeScript.