JavaScript Coding Challenge — Form Validation

Oleks Tsukur
1 min readMar 6, 2017

--

Consider this quite common signup form, don’t worry about styling here.

<form>
<input name="name"> // required
<input name="surname">
<input name="phone"> // required and valid number
<input name="email"> // required and valid email
<input name="address">
<button type="submit">Submit</button>
</form>

Write a validation event handler that is run on form submit. Validation rules should be derived from inputs’ attributes. With that being said, feel free to add additional attributes as needed.

You may use jQuery or pure JavaScript to implement your solution.

--

--

Oleks Tsukur

Husband. Father. Listener. Teacher on SkillShare. Other than that, love Front-End Web Development.