Validate - Radio button & textfield not working?
I have a form with both radio buttons and texfield
My code as follow:
- <script src="/js/jquery.js" type="text/javascript"></script>
- <script src="/js/jquery.validate.js" type="text/javascript"></script>
<script>
$('#blreview').validate({
rules: {
3232a: {
required: true,
minlength: 1
}
},
messages: {
3232a: {
required: "Please rate",
minlength: "Please select atleast two items" },
}
}); // End validation rules/messages
</script>
- </head>
- <body>
- <form id="blreview">
- <input name="3232a" type="radio" class="star" value="1">
<input name="3232a" type="radio" class="star" value="2">
<input name="3232a" type="radio" class="star" value="3">
<input name="3232a" type="radio" class="star" value="4">
<input name="3232a" type="radio" class="star" value="5">
<label for="3232a" class="error" style="display: none;">Please rate the Value for Money</label>
- <textarea style="width:100%;height:200px;"
id="textInputN" name="comment" rows="12" required=""></textarea><br>
- SUBMIT
- </form>
Now... On subit with blank fields, I only get a notice below the textarea stating: Please fill out field
If I add: required="" to radio button I get a notice floating top of my browser stating: Please select one of these options...
How can I get that error notice to display at the radio button when required="" is added?
Thanks
Stefan
(jQuery rookie)