Skip to content

Conversation

@Euphoric-Coder
Copy link

Issue (Number)

Closes #2042


Description

This PR fixes the invalid input alert that appeared when users pressed Backspace on an empty or single-digit input in the Armstrong Number Checker project.
The previous implementation triggered an intrusive alert() and page reload even during normal text editing, leading to a poor user experience.

Changes Made

  • Removed inline onkeyup="textfxn()" from armstrong.html
  • Replaced alert-based validation with inline error handling in armstrong.js
  • Disabled validation during normal typing and deletion
  • Displayed non-blocking feedback message (⚠️ Please enter a valid positive number.)
  • Improved readability and user experience consistency

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have made this from my own
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • The title of my pull request is a short description of the requested changes

ATTACH SCREEN-SHOTS / DEPLOYMENT LINK

Before:
An alert popup saying “Invalid input!” appeared when pressing Backspace on empty/single-digit input.

After:
No alert interruption. Inline message appears under the input box, maintaining a smooth typing flow.

Deployment Link:
https://frontendprojects.netlify.app/projects/armstrongchecker/armstrong

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

Successfully merging this pull request may close these issues.

1 participant