-
Notifications
You must be signed in to change notification settings - Fork 0
/
investnow.html
84 lines (79 loc) · 4.13 KB
/
investnow.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mutual Fund Investment Form</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css">
<style>
</style>
</head>
<body>
<div class="container mt-5">
<h1 class="text-center" id="textHeading">Mutual Fund Investment Form</h1>
<form action="" class="p-4 border rounded shadow">
<div class="mb-3">
<label for="fund_name" class="form-label">Mutual Fund Name:</label>
<p id="fundName" class="form-control-static">Fetching...</p>
</div>
<div class="mb-3">
<label for="aum_invested" class="form-label">AUM Invested:</label>
<p id="aumInvested" class="form-control-static">Fetching...</p>
</div>
<div class="mb-3">
<label for="exit_load" class="form-label">Exit Load :</label>
<p id="exitLoad" class="form-control-static">Fetching...</p>
</div>
<div class="mb-3">
<label for="current_nav" class="form-label">Current NAV :</label>
<p id="currentNav" class="form-control-static">Fetching...</p>
</div>
<div class="mb-3">
<label for="investment_amount" class="form-label">Investment Amount:</label>
<!-- <input type="number" id="investment_amount" name="investment_amount" min="1000" step="100" class="form-control" required> -->
<input type="number" id="investment_amount" value="1000"/>
<p id="walletBalance" class="form-text text-muted">Available Wallet Balance: Rs <span id="balance">100000</span> </p>
<p id="unitsAllotted" style="display: none;" class="form-text text-muted">Units allotted: <span id="units"> 5</span> </p>
</div>
<!-- <div class="mb-3">
<label class="form-label">Investment Type:</label>
<div class="form-check">
<input type="radio" id="sip" name="investment_type" value="sip" class="form-check-input" required>
<label for="sip" class="form-check-label">SIP</label>
</div>
<div class="form-check">
<input type="radio" id="one_time" name="investment_type" value="one_time" class="form-check-input" required>
<label for="one_time" class="form-check-label">One-Time</label>
</div>
</div> -->
<button type="button" id="investBtn" class="btn btn-primary">Submit</button>
</form>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Simulate fetching data from the backend
// var fundName = "Example Mutual Fund";
// var aumInvested = "Rs 100 crore";
// var walletBalance = 100000; // Replace with actual wallet balance
// // Display fetched data in the form
// document.getElementById("fundName").textContent = fundName;
// document.getElementById("aumInvested").textContent = aumInvested;
// // document.getElementById("walletBalance").textContent = "Available Wallet Balance: Rs " + walletBalance.toFixed(2);
// document.getElementById("exitLoad").textContent=0.2;
// // Add event listener to validate investment amount
// document.getElementById("investment_amount").addEventListener("input", function() {
// var investmentAmount = parseFloat(this.value);
// if (isNaN(investmentAmount)) {
// return;
// }
// if (investmentAmount > walletBalance) {
// this.setCustomValidity("Investment amount can't exceed wallet balance.");
// } else {
// this.setCustomValidity("");
// }
// });
</script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="investnow.js"></script>
</body>
</html>