Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the index.html removing the issues #3

Open
sayantann7 opened this issue Sep 29, 2024 · 1 comment
Open

Updating the index.html removing the issues #3

sayantann7 opened this issue Sep 29, 2024 · 1 comment

Comments

@sayantann7
Copy link

  1. Missing Closing Tag in Back Section
    Issue Description:
    There is an incomplete <div class= in the "back" section of the code.

Explanation:
The incomplete div tag can cause rendering issues because the browser will not be able to interpret it correctly. This may lead to broken layout or missing elements on the page.

Fix:
Close the div tag properly, and ensure that all the child elements are correctly nested.

  1. Incorrect num Type in Input Fields
    Issue Description:
    is used for the card number fields.

Explanation:
HTML doesn’t have an input type of num. The correct type should be number. While most browsers might handle this gracefully, using num is technically incorrect and could cause issues with validation or rendering in certain contexts.

Fix:
Change type="num" to type="number".

  1. Non-Semantic Use of div for Credit Card Information
    Issue Description:
    The credit card details (number, card holder, expiration date, CCV) are enclosed in div elements without input fields.

Explanation:
For accessibility and correct form behavior, each piece of card information should be wrapped in semantic HTML elements such as input, not just div. The current structure prevents users from interacting with the fields and also breaks form submission.

Fix:
Replace the div elements with proper input fields where user input is expected.

  1. Placeholder Expiration Year and Future-Proofing
    Issue Description:
    The expiration year options are hardcoded with years from 2016 to 2025.

Explanation:
Hardcoding the years limits the usability of the form after 2025. This can cause usability issues in the future, as users won’t be able to select a valid expiration year beyond 2025.

Fix:
Instead of hardcoding the years, dynamically generate them based on the current year.

Code After Fix (in JavaScript):
javascript
Copy code
const currentYear = new Date().getFullYear();
const yearSelect = document.getElementById('card-expiration-year');

for (let i = currentYear; i <= currentYear + 10; i++) {
const option = document.createElement('option');
option.value = i;
option.textContent = i;
yearSelect.appendChild(option);
}
5. Lack of Form Validation
Issue Description:
The form lacks client-side validation for important fields like the card number, expiration date, and CCV.

Explanation:
Without validation, users could submit incomplete or incorrect data, leading to errors in processing. Client-side validation improves the user experience by providing immediate feedback.

Fix:
Implement basic validation for each field, ensuring that the card number, expiration date, and CCV follow standard formats. You can use HTML5 attributes like required, pattern, and maxlength for basic validation.

  1. Missing ARIA Labels and Accessibility Features
    Issue Description:
    The form lacks accessibility features such as ARIA labels and tabindex attributes for interactive elements.

Explanation:
For users with disabilities, such as those using screen readers, accessibility features ensure that the form can be navigated and understood. Without ARIA labels and proper keyboard navigation, the form may not be usable for everyone.

Fix:
Add appropriate ARIA labels and ensure all interactive elements are accessible via keyboard navigation.

@Soyvor
Copy link
Contributor

Soyvor commented Sep 29, 2024

Ok solve the issue and move forward with them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants