Skip to content

[Bug]: Duplicate HTML IDs for submit-btn, btn-label, btn-loading break the loading animation #478

@Daksh7785

Description

@Daksh7785

Describe the bug

In templates/index.html, the submit button and its inner spans are rendered twice with identical id attributes:

  • id="submit-btn" appears at line 505 and line 518
  • id="btn-label" appears at line 506 and line 519
  • id="btn-loading" appears at line 508 and line 520

Why this is a problem

document.getElementById() always returns only the first matching element. The loading spinner logic targets btnLabel and btnLoading by ID. The second submit button (inside .form-actions) is effectively dead — clicking the visible "Generate My Projects" button may show no spinner at all, making the app appear frozen.

Steps to reproduce

  1. Open https://mydevpath-github.vercel.app/
  2. Open DevTools → Console → type document.querySelectorAll("#submit-btn").length
  3. Observe the count is 2 — confirming duplicate IDs
  4. Submit the form and notice the loading spinner may not work correctly

Expected behavior

Exactly one submit button with one unique ID per page. The orphaned duplicate outside .form-actions should be removed.

Suggested fix

Remove lines 504–512 in templates/index.html (the first orphaned <button type="submit"> block). Keep only the submit button inside the div.form-actions container.

Files affected

  • templates/index.html (lines ~504–521)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions