Skip to content

Commit

Permalink
Fixed FD Calculator: resolved non-functional button issue
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay0611 committed Nov 25, 2024
1 parent 8e7e543 commit 62f0253
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
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

0 comments on commit 62f0253

Please sign in to comment.