I am trying to display an error message using jQuery. It is not displaying when there is an error. I have taken this from another question and modified it.
The jQuery (contained in an if exception test which is triggered) is:
$("#projectIDSelect").html("Please select a Project ID").addClass("error-msg"); // chained methods
The html is:
<p>
<label for="projectIDSelect">Project ID<span class="required">*</span></label>
<!--Place to load the Project Names into for selection -->
<select class="col-lg-3 col-md-3 col-sm-4 col-xs-6" style="height:30px; color:black;" id="projectIDSelect" name="projectIDSelect" required>
<option value="" disabled selected>Select a Project</option>
</select>
</p>
Also, after this has run the dropdown no longer contains the options (these have been dynamically loaded).