Creating An Effective Multistep Form For Better User Experience<\/h1>\nAmejimaobari Ollornwi<\/address>\n 2024-12-03T10:00:00+00:00
\n 2024-12-03T23:35:19+00:00
\n <\/header>\n
For a multistep form, planning involves structuring questions logically across steps, grouping similar questions, and minimizing the number of steps and the amount of required information for each step. Whatever makes each step focused and manageable is what should be aimed for.<\/p>\n
In this tutorial, we will create a multistep form for a job application. Here are the details we are going to be requesting from the applicant at each step:<\/p>\n
\n- Personal Information<\/strong>
\nCollects applicant\u2019s name, email, and phone number.<\/li>\n- Work Experience<\/strong>
\nCollects the applicant\u2019s most recent company, job title, and years of experience.<\/li>\n- Skills & Qualifications<\/strong>
\nThe applicant lists their skills and selects their highest degree.<\/li>\n- Review & Submit<\/strong>
\nThis step is not going to collect any information. Instead, it provides an opportunity for the applicant to go back and review the information entered in the previous steps of the form before submitting it.<\/li>\n<\/ul>\nYou can think of structuring these questions as a digital way of getting to know somebody. You can\u2019t meet someone for the first time and ask them about their work experience without first asking for their name.<\/p>\n
Based on the steps we have above, this is what the body of our HTML with our form should look like. First, the main <form><\/code> element:<\/p>\n<form id=\"jobApplicationForm\">\n <!-- Step 1: Personal Information -->\n <!-- Step 2: Work Experience -->\n <!-- Step 3: Skills & Qualifications -->\n <!-- Step 4: Review & Submit -->\n<\/form>\n<\/code><\/pre>\nStep 1<\/strong> is for filling in personal information, like the applicant\u2019s name, email address, and phone number:<\/p>\n\n<form id=\"jobApplicationForm\">\n <!-- Step 1: Personal Information -->\n <fieldset class=\"step\" id=\"step-1\">\n <legend id=\"step1Label\">Step 1: Personal Information<\/legend>\n <label for=\"name\">Full Name<\/label>\n <input type=\"text\" id=\"name\" name=\"name\" required \/>\n <label for=\"email\">Email Address<\/label>\n <input type=\"email\" id=\"email\" name=\"email\" required \/>\n <label for=\"phone\">Phone Number<\/label>\n <input type=\"tel\" id=\"phone\" name=\"phone\" required \/>\n <\/fieldset>\n\n <!-- Step 2: Work Experience -->\n <!-- Step 3: Skills & Qualifications -->\n <!-- Step 4: Review & Submit -->\n<\/form>\n<\/code><\/pre>\n<\/div>\nOnce the applicant completes the first step, we\u2019ll navigate them to Step 2<\/strong>, focusing on their work experience so that we can collect information like their most recent company, job title, and years of experience. We\u2019ll tack on a new <fieldset><\/code> with those inputs:<\/p>\n\n<form id=\"jobApplicationForm\">\n <!-- Step 1: Personal Information -->\n\n <!-- Step 2: Work Experience -->\n <fieldset class=\"step\" id=\"step-2\" hidden>\n <legend id=\"step2Label\">Step 2: Work Experience<\/legend>\n <label for=\"company\">Most Recent Company<\/label>\n <input type=\"text\" id=\"company\" name=\"company\" required \/>\n <label for=\"jobTitle\">Job Title<\/label>\n <input type=\"text\" id=\"jobTitle\" name=\"jobTitle\" required \/>\n <label for=\"yearsExperience\">Years of Experience<\/label>\n <input\n type=\"number\"\n id=\"yearsExperience\"\n name=\"yearsExperience\"\n min=\"0\"\n required\n \/>\n <\/fieldset>\n\n <!-- Step 3: Skills & Qualifications -->\n <!-- Step 4: Review & Submit -->\n<\/form>\n<\/code><\/pre>\n<\/div>\nStep 3<\/strong> is all about the applicant listing their skills and qualifications for the job they\u2019re applying for:<\/p>\n\n<form id=\"jobApplicationForm\">\n <!-- Step 1: Personal Information -->\n <!-- Step 2: Work Experience -->\n\n <!-- Step 3: Skills & Qualifications -->\n <fieldset class=\"step\" id=\"step-3\" hidden>\n <legend id=\"step3Label\">Step 3: Skills & Qualifications<\/legend>\n <label for=\"skills\">Skill(s)<\/label>\n <textarea id=\"skills\" name=\"skills\" rows=\"4\" required><\/textarea>\n <label for=\"highestDegree\">Degree Obtained (Highest)<\/label>\n <select id=\"highestDegree\" name=\"highestDegree\" required>\n <option value=\"\">Select Degree<\/option>\n <option value=\"highschool\">High School Diploma<\/option>\n <option value=\"bachelor\">Bachelor's Degree<\/option>\n <option value=\"master\">Master's Degree<\/option>\n <option value=\"phd\">Ph.D.<\/option>\n <\/select>\n <\/fieldset>\n <!-- Step 4: Review & Submit -->\n <fieldset class=\"step\" id=\"step-4\" hidden>\n <legend id=\"step4Label\">Step 4: Review & Submit<\/legend>\n <p>Review your information before submitting the application.<\/p>\n <button type=\"submit\">Submit Application<\/button>\n <\/fieldset>\n<\/form>\n<\/code><\/pre>\n<\/div>\nAnd, finally, we\u2019ll allow the applicant to review their information before submitting it:<\/p>\n
\n<form id=\"jobApplicationForm\">\n <!-- Step 1: Personal Information -->\n <!-- Step 2: Work Experience -->\n <!-- Step 3: Skills & Qualifications -->\n\n <!-- Step 4: Review & Submit -->\n <fieldset class=\"step\" id=\"step-4\" hidden>\n <legend id=\"step4Label\">Step 4: Review & Submit<\/legend>\n <p>Review your information before submitting the application.<\/p>\n <button type=\"submit\">Submit Application<\/button>\n <\/fieldset>\n<\/form>\n<\/code><\/pre>\n<\/div>\nNotice<\/strong>: We\u2019ve added a hidden<\/code> attribute to every fieldset<\/code> element but the first one. This ensures that the user sees only the first step. Once they are done with the first step, they can proceed to fill out their work experience on the second step by clicking a navigational button. We\u2019ll add this button later on.<\/p>\n\n
\n 2024-12-03T23:35:19+00:00
\n <\/header>\n
\nCollects applicant\u2019s name, email, and phone number.<\/li>\n
\nCollects the applicant\u2019s most recent company, job title, and years of experience.<\/li>\n
\nThe applicant lists their skills and selects their highest degree.<\/li>\n
\nThis step is not going to collect any information. Instead, it provides an opportunity for the applicant to go back and review the information entered in the previous steps of the form before submitting it.<\/li>\n<\/ul>\n
You can think of structuring these questions as a digital way of getting to know somebody. You can\u2019t meet someone for the first time and ask them about their work experience without first asking for their name.<\/p>\n
Based on the steps we have above, this is what the body of our HTML with our form should look like. First, the main Step 1<\/strong> is for filling in personal information, like the applicant\u2019s name, email address, and phone number:<\/p>\n Once the applicant completes the first step, we\u2019ll navigate them to Step 2<\/strong>, focusing on their work experience so that we can collect information like their most recent company, job title, and years of experience. We\u2019ll tack on a new Step 3<\/strong> is all about the applicant listing their skills and qualifications for the job they\u2019re applying for:<\/p>\n And, finally, we\u2019ll allow the applicant to review their information before submitting it:<\/p>\n Notice<\/strong>: We\u2019ve added a <form><\/code> element:<\/p>\n
<form id=\"jobApplicationForm\">\n <!-- Step 1: Personal Information -->\n <!-- Step 2: Work Experience -->\n <!-- Step 3: Skills & Qualifications -->\n <!-- Step 4: Review & Submit -->\n<\/form>\n<\/code><\/pre>\n
<form id=\"jobApplicationForm\">\n <!-- Step 1: Personal Information -->\n <fieldset class=\"step\" id=\"step-1\">\n <legend id=\"step1Label\">Step 1: Personal Information<\/legend>\n <label for=\"name\">Full Name<\/label>\n <input type=\"text\" id=\"name\" name=\"name\" required \/>\n <label for=\"email\">Email Address<\/label>\n <input type=\"email\" id=\"email\" name=\"email\" required \/>\n <label for=\"phone\">Phone Number<\/label>\n <input type=\"tel\" id=\"phone\" name=\"phone\" required \/>\n <\/fieldset>\n\n <!-- Step 2: Work Experience -->\n <!-- Step 3: Skills & Qualifications -->\n <!-- Step 4: Review & Submit -->\n<\/form>\n<\/code><\/pre>\n<\/div>\n
<fieldset><\/code> with those inputs:<\/p>\n
<form id=\"jobApplicationForm\">\n <!-- Step 1: Personal Information -->\n\n <!-- Step 2: Work Experience -->\n <fieldset class=\"step\" id=\"step-2\" hidden>\n <legend id=\"step2Label\">Step 2: Work Experience<\/legend>\n <label for=\"company\">Most Recent Company<\/label>\n <input type=\"text\" id=\"company\" name=\"company\" required \/>\n <label for=\"jobTitle\">Job Title<\/label>\n <input type=\"text\" id=\"jobTitle\" name=\"jobTitle\" required \/>\n <label for=\"yearsExperience\">Years of Experience<\/label>\n <input\n type=\"number\"\n id=\"yearsExperience\"\n name=\"yearsExperience\"\n min=\"0\"\n required\n \/>\n <\/fieldset>\n\n <!-- Step 3: Skills & Qualifications -->\n <!-- Step 4: Review & Submit -->\n<\/form>\n<\/code><\/pre>\n<\/div>\n
<form id=\"jobApplicationForm\">\n <!-- Step 1: Personal Information -->\n <!-- Step 2: Work Experience -->\n\n <!-- Step 3: Skills & Qualifications -->\n <fieldset class=\"step\" id=\"step-3\" hidden>\n <legend id=\"step3Label\">Step 3: Skills & Qualifications<\/legend>\n <label for=\"skills\">Skill(s)<\/label>\n <textarea id=\"skills\" name=\"skills\" rows=\"4\" required><\/textarea>\n <label for=\"highestDegree\">Degree Obtained (Highest)<\/label>\n <select id=\"highestDegree\" name=\"highestDegree\" required>\n <option value=\"\">Select Degree<\/option>\n <option value=\"highschool\">High School Diploma<\/option>\n <option value=\"bachelor\">Bachelor's Degree<\/option>\n <option value=\"master\">Master's Degree<\/option>\n <option value=\"phd\">Ph.D.<\/option>\n <\/select>\n <\/fieldset>\n <!-- Step 4: Review & Submit -->\n <fieldset class=\"step\" id=\"step-4\" hidden>\n <legend id=\"step4Label\">Step 4: Review & Submit<\/legend>\n <p>Review your information before submitting the application.<\/p>\n <button type=\"submit\">Submit Application<\/button>\n <\/fieldset>\n<\/form>\n<\/code><\/pre>\n<\/div>\n
<form id=\"jobApplicationForm\">\n <!-- Step 1: Personal Information -->\n <!-- Step 2: Work Experience -->\n <!-- Step 3: Skills & Qualifications -->\n\n <!-- Step 4: Review & Submit -->\n <fieldset class=\"step\" id=\"step-4\" hidden>\n <legend id=\"step4Label\">Step 4: Review & Submit<\/legend>\n <p>Review your information before submitting the application.<\/p>\n <button type=\"submit\">Submit Application<\/button>\n <\/fieldset>\n<\/form>\n<\/code><\/pre>\n<\/div>\n
hidden<\/code> attribute to every
fieldset<\/code> element but the first one. This ensures that the user sees only the first step. Once they are done with the first step, they can proceed to fill out their work experience on the second step by clicking a navigational button. We\u2019ll add this button later on.<\/p>\n