Jquery Isn't alerting me when their is no value selected from the Rating form. Would it be because selected="selected" is actually being seen as a value to jquery ?
<label for="rating">Rating</label>
<select id="rating" name="rating" />
<option selected="selected" disabled="disabled">Select a Rating</option>
<option value="Terrible">Terrible</option>
<option value="Fair">Fair</option>
<option value="Ok">Ok</option>
<option value="Good">Good</option>
<option value="Excellent">Excellent</option>
</select>
$(document).ready(function(){
// No value for movie_title
if ($('#movie_title').val() == "" ) {
alert ("No Film");
}
// No Value for actor
if ($('#leading_name').val() == "") {
alert ("No actor");
}
// No value for rating
if ($('#rating').val() == "") {
alert ("No Rating");
}
//No value for review
if ($('#review').val() == "") {
alert ("No review");
}
// Focus on first form field.
$("input:text:visible:first").focus();
})