Add User In this assignment, let's build an Add User form by applying the concepts we learned till now.
Refer to the below image.
add-user Instructions:
Add the HTML form, input, p, select and button elements to the HTML code Add an id addUserForm to the HTML form element Add the ids name and email to the HTML input elements respectively Add the ids nameErrMsg and emailErrMsg to the HTML paragraph elements respectively Add an id status to the HTML select element Add the ids genderMale and genderFemale to the HTML input radio elements respectively Add the name gender to the HTML input elements with the ids genderMale and genderFemale By following the above instructions, achieve the given functionality.
When the HTML form element with the id addUserForm submitted, Practice adding the error message to the HTML paragraph element with the id nameErrMsg based on the value of the HTML input element with the id name. Practice adding the error message to the HTML paragraph element with the id emailErrMsg based on the value of the HTML input element with the id email. Practice making a POST request to the https://gorest.co.in/public-api/users using the form data as the request object. Practice adding the email error message to the emailErrMsg element if the email has already taken. Practice logging the response in the console. Resources CSS Font families used:
Roboto