reactjs18-3d-portfolio icon indicating copy to clipboard operation
reactjs18-3d-portfolio copied to clipboard

Empty Input Values Allowed in Contact Form - Update Required

Open awelrisak opened this issue 1 year ago • 1 comments

Issue Description

Currently, users are able to send email messages with empty input values in the Contact form. This behavior is not desirable as it leads to incomplete and potentially useless messages. To ensure that meaningful information is captured in every email, we need to update the Contact form to make certain inputs required and prevent the submission of empty input values.

Proposed Solution

To address this issue, we should implement the following changes to the Contact form:

Make certain inputs required: Identify the necessary fields that should not be left empty, such as name, email address, and message content. Mark these inputs as required in the form's HTML code. Client-side validation: Implement client-side validation using JavaScript to prevent form submission if required inputs are left empty. Display appropriate error messages near the empty inputs, prompting users to provide the required information. Server-side validation: Although client-side validation provides a good user experience, it's essential to have server-side validation as well. Double-check that the required inputs are not empty on the server-side before processing the form submission. If any required fields are missing, display an error message and prevent the email from being sent. Clear form after submission: After a successful form submission, clear the input fields to provide a fresh and user-friendly experience for subsequent messages. Acceptance Criteria

Users should not be able to submit the Contact form with empty required fields. Validation errors should be displayed near the empty inputs in real-time. Server-side validation should be implemented to catch any missed client-side validation or potential malicious attempts. Upon successful submission, the form should clear all input fields.

awelrisak avatar Jun 30 '23 11:06 awelrisak