|
69 | 69 | margin-top: 10px;
|
70 | 70 | }
|
71 | 71 |
|
72 |
| - .login-container input[type="submit"]:hover, |
| 72 | + /*.login-container input[type="submit"]:hover,*/ |
73 | 73 | .login-container .login-button:hover {
|
74 | 74 | background-color: #6a11cb;
|
75 | 75 | }
|
76 | 76 |
|
| 77 | + .login-container .login-button:disabled { |
| 78 | + background-color: #2575fc; /* Original color */ |
| 79 | + filter: brightness(0.8); /* Darkens the button */ |
| 80 | + cursor: not-allowed; |
| 81 | + } |
| 82 | +
|
77 | 83 | .forgot-password {
|
78 | 84 | margin-top: 10px;
|
79 | 85 | font-size: 12px;
|
|
86 | 92 | }
|
87 | 93 |
|
88 | 94 | .error-message {
|
89 |
| - color: #6a11cb; |
| 95 | + color: #2e4c5d; |
90 | 96 | font-size: 14px;
|
91 | 97 | margin-top: 10px;
|
92 | 98 | }
|
|
144 | 150 | <form id="form1" runat="server" class="login-container">
|
145 | 151 | <h2>Customer Login</h2>
|
146 | 152 | <!-- Mobile Number Field -->
|
147 |
| - <asp:TextBox ID="mnumber" runat="server" placeholder="Mobile Number" type="text"></asp:TextBox> |
| 153 | + <asp:TextBox ID="mnumber" runat="server" placeholder="Mobile Number" type="text" onkeyup="validateForm()"></asp:TextBox> |
148 | 154 |
|
149 | 155 | <!-- Password Field -->
|
150 |
| - <asp:TextBox ID="password" runat="server" placeholder="Password" type="password"></asp:TextBox> |
| 156 | + <asp:TextBox ID="password" runat="server" placeholder="Password" type="password" onkeyup="validateForm()"></asp:TextBox> |
151 | 157 |
|
152 | 158 | <!-- Login Button -->
|
153 | 159 | <div>
|
154 |
| - <asp:Button ID="buttonlogin" runat="server" onclick="loginm" Text="Login" CssClass="login-button" /> |
| 160 | + <asp:Button ID="buttonlogin" runat="server" onclick="loginm" Text="Login" CssClass="login-button" Enabled="false" /> |
155 | 161 | </div>
|
156 | 162 | <br />
|
157 | 163 | <div>
|
|
188 | 194 | showPopup();
|
189 | 195 | }
|
190 | 196 | }
|
| 197 | +
|
| 198 | + // Function to validate the form |
| 199 | + function validateForm() { |
| 200 | + var mnumber = document.getElementById('<%= mnumber.ClientID %>').value; |
| 201 | + var password = document.getElementById('<%= password.ClientID %>').value; |
| 202 | + var buttonlogin = document.getElementById('<%= buttonlogin.ClientID %>'); |
| 203 | +
|
| 204 | + if (mnumber.trim() !== "" && password.trim() !== "") { |
| 205 | + buttonlogin.disabled = false; |
| 206 | + buttonlogin.style.cursor = 'pointer'; |
| 207 | + } else { |
| 208 | + buttonlogin.disabled = true; |
| 209 | + buttonlogin.style.cursor = 'not-allowed'; |
| 210 | + } |
| 211 | + } |
| 212 | +
|
191 | 213 | </script>
|
192 | 214 | </html>
|
0 commit comments