I’m trying to check the selected value of a dropdown box if its “Please Select..” I need to show the relevant alert message saying please select, but even if I choose “ETF Too Big” from the drop down box I still get the alert box saying please select. Can someone please correct my error below as I can’t see where I have gone wrong. When I hover over the variable Diarised it shows me the relevant selected text from the drop down but yet it still gives me the alert box.
var Diarised = $('[id*=drpDiarisedReason] :selected').text();
if (Diarised == "Please Select..");
{
alert('Please Select Diarised Reason');
return false;
}
This is my HTML
<select id="drpDiarisedReason">
<option value="">Please Select..</option>
<option value="1">ETF Too Big</option>
<option value="2">Equipment Cost</option>
<option value="3">Spend Too Little</option>
</select>
Thank you for your time.
See demo here