Web-Dev-For-Beginners icon indicating copy to clipboard operation
Web-Dev-For-Beginners copied to clipboard

Included more robust client side validation

Open Roshan-Metrix opened this issue 3 months ago • 5 comments

Included more robust client side validation

I've added two new functions, validateLogin() and validateRegister(), which check for empty fields on the respective forms. The login() and register() functions now call these validation functions before attempting to interact with the simulated backend. This ensures that the user is immediately notified of any missing information. I also corrected the id for the currency display on the dashboard from balance-currency to currency.

Key Improvements

  • Added validateLogin() and validateRegister() functions
    • These functions check for empty fields before backend interaction.
    • Prevents unnecessary API calls and improves user experience.
  • Integrated validation into login() and register() flows
    • Ensures form integrity before proceeding with account logic.
  • Corrected currency display ID
    • Changed balance-currency to currency for accurate DOM targeting and cleaner UI rendering.

Impact

  • Improves UX by catching input errors early.
  • Reduces backend load from invalid requests.
  • Enhances maintainability with modular validation logic.
  • Fixes a UI bug that could confuse users viewing account balances.

Roshan-Metrix avatar Sep 21 '25 02:09 Roshan-Metrix

@microsoft-github-policy-service agree @microsoft-github-policy-service agree company="Roshan-Metrix"

Roshan-Metrix avatar Sep 21 '25 02:09 Roshan-Metrix

@microsoft-github-policy-service agree

Roshan-Metrix avatar Sep 21 '25 02:09 Roshan-Metrix

@microsoft-github-policy-service agree company="Microsoft"

Roshan-Metrix avatar Sep 21 '25 02:09 Roshan-Metrix

@Roshan-Metrix please fix branch conflicts

leestott avatar Oct 03 '25 08:10 leestott

@Roshan-Metrix please fix the branch conflict

leestott avatar Oct 11 '25 14:10 leestott