I am currently in the process of updating the styling from bootstrap 3 to bootstrap 5. The issue I am facing is that in the bootstrap 3 version, when I click the "save" button without filling any text boxes, the page displays a validation message like this:
bootstrap3 version
However, after changing over to bootstrap 5, the validation messages are no longer appearing:
bootstrap5 version
Below is my code for the bootstrap 5 version:
<head>:
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Resources from https://jqueryui.com/datepicker/#dropdown-month-year
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">-->
</head>
<body>:
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="form-group">
@Html.LabelFor(model => model.Software, htmlAttributes: new { @class = "control-label col-md-4 required " })
<div class="col-md-8">
@Html.EditorFor(model => model.Software, new { htmlAttributes = new { @class = "form-control", style = "max-width:100%" } })
@Html.ValidationMessageFor(model => model.Software, "", new { @class = "text-danger" })
<p id="errorSoftware" hidden=hidden class=text-danger></p>
</div>
</div>
</div>
<div class="col-md-6">
</div>
</div>
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
<script src="../../Scripts/myJavaScript.js"></script>
}
After thorough testing and debugging, I believe the problem does not lie with the following:
_Layout.cshtml. I made some changes to the reference code in the Layout page, but another 'ADD BUILDING' view page is functioning correctly using the same _Layout view.
Add Building pageJavaScript functions and reference links. I attempted to remove all JavaScript functions and references as in the 'ADD HARDWARE' view page, but it still did not resolve the issue.
Thank you!