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

Fix FD Calculator Buttons and Improve Accessibility with Legend #3337

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/FDCalculator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('calculateBtn2').addEventListener('click', function() {
document.getElementById('calculatefd').addEventListener('click', function() {
const principal = parseFloat(document.getElementById('principal').value);
const rate = parseFloat(document.getElementById('rate').value);
const years = parseInt(document.getElementById('years1').value);
Expand All @@ -25,7 +25,7 @@ document.addEventListener('DOMContentLoaded', function() {
document.getElementById('maturityAmount').textContent = formatter.format(maturityAmount);
});

document.getElementById('clearBtn1').addEventListener('click', function() {
document.getElementById('clearfd').addEventListener('click', function() {
clearInputs();
});

Expand Down
10 changes: 6 additions & 4 deletions tools/sip.html
Original file line number Diff line number Diff line change
Expand Up @@ -2334,23 +2334,25 @@ <h5>Result:</h5>
<form id="fixed-deposit-calculator"
style="display: flex; flex-direction: column; justify-content: center; align-items: center;">
<fieldset>
<legend>Fixed Deposit Calculator</legend>
<div class="form-group">
<label for="principal">Principal Amount (β‚Ή):</label>
<input type="number" id="principal" placeholder="Enter Principal Amount" required>
<div id="principalError" class="error-message"></div>
</div>
<div class="form-group">
<label for="rate">Annual Interest Rate (%):</label>
<input type="number" id="rate" step="0.01" placeholder="Enter Annual Interest Rate" required>
<div id="rateError" class="error-message"></div>
</div>
<div class="form-group">
<label for="years">Time Period (in years):</label>
<input type="number" id="years1" placeholder="Enter Time Period" required>
<div id="yearsError" class="error-message"></div>
</div>
<div class="btn-calculate">
<button id="calculateBtn2" type="button" class="btn btn-calculate">Calculate</button>
<button id="clearBtn1" type="button" class="btn btn-clear">
<p class="btn-text">Clear</p>
</button>
<button id="calculatefd" type="button" class="btn btn-calculate">Calculate</button>
<button id="clearfd" type="button" class="btn btn-clear"> Clear </button>
</div>
</fieldset>
</form>
Expand Down