|
55 | 55 | // Add regular expression check to make sure plan field is not empty
|
56 | 56 | var planRegex = /.+/;
|
57 | 57 | if (!planRegex.test(plan)) {
|
58 |
| - planError = document.getElementById("plan-error"); |
| 58 | + const planError = document.getElementById("plan-error"); |
59 | 59 | planError.style.display = "block";
|
60 |
| - plan = document.getElementById("plan"); |
61 |
| - plan.style.outline = "2px solid red"; |
| 60 | + const planField = document.getElementById("plan"); |
| 61 | + planField.style.outline = "2px solid red"; |
62 | 62 | errors.push("Plan is invalid");
|
63 | 63 | } else {
|
64 | 64 | const planError = document.getElementById("plan-error");
|
65 | 65 | planError.style.display = "none";
|
66 |
| - const plan = document.getElementById("plan"); |
67 |
| - plan.style.outline = ""; |
| 66 | + const planField = document.getElementById("plan"); |
| 67 | + planField.style.outline = ""; |
68 | 68 | }
|
69 | 69 |
|
70 | 70 | // Regular expression check for login #s
|
@@ -233,6 +233,7 @@ <h4> Sample Identify </h4>
|
233 | 233 | <span class="error-message" id="email-error">Please enter a valid email address.</span>
|
234 | 234 | <label for="plan">Plan:</label>
|
235 | 235 | <input type="text" id="plan" value="Premium">
|
| 236 | + <span class="error-message" id="plan-error">Please enter a valid Plan name.</span> |
236 | 237 | <label for="logins">Logins:</label>
|
237 | 238 | <input type="text" id="logins" value="2">
|
238 | 239 | <span class="error-message" id="logins-error">Please enter only numbers in the 'Logins' field.</span>
|
|
0 commit comments