What is directly after your select box?  Sometimes if you have
something that is either hidden or somewhat difficult to see, it will
append to that instead and not show you your error message.

errorPlacement: function(error, element) {
                        $('#errordiv').show();
                        error.appendTo(element.next());
                },

instead of error.appendTo(element.next());, try
error.appendTo(element.parent()) or error.appendTo(element.next.
().next());

Also, try removing the javascript inside the select form, it may be
overriding the validate script.  Try this:

<label for='eventvenue'>City:</label><select
name="eventvenue"id="eventvenue">
<option value=""></option>
<option value="1">Portsmouth</option>
</select>

$(document).ready(function(){
    $("#eventForm").validate({
                rules: {
                uploadedfile: {
                        required: true
                },
                eventvenue: {
                        required: true
                }
                },
                messages: {
                uploadedfile: {
                        required: "Please Select a File"
                },
                eventvenue: {
                        required: "Please Select a City"
                }
                }
        });

});


I had the same difficulty once. I also removed the labels, as they
were too much of a hassle.  But that is just me.

Hope this helps!!

On Sep 5, 11:24 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hello All!
>
> First off, the jQuery Validator plugin is great! All the functionality
> you could want in a form validation module.  But, I have a small
> problem with select boxes and the 'required' attributes.
>
> I have this <select> form:
>
> <label for='eventvenue'>City:</label><select name="eventvenue"
> id="eventvenue"
> onchange="document.getElementById('menus').style.display='inline';"
> title='Please select a city.'>
> <option value=""></option>
> <option value="1">Portsmouth</option></select>
>
> And this is t he accompanying validation code:
>
> $(document).ready(function(){
>     $("#eventForm").validate({
>                 rules: {
>                 uploadedfile: {
>                         required: true
>                 },
>                 eventvenue: {
>                         required: true
>                 }
>                 }
>         });
>
> });
>
> However, when I select the 'empty' option, no error message is
> displayed.
>
> Any help would be appriciated, thank you.

Reply via email to