From: Alpha Omega on
Hi,

I have this multiple select:

<select id="sel_dest" name="dest_var[]" multiple disabled="disabled"
size="10">
<option value="" selected>Destinatario</option>
<option value="1"> .........
</select>


how can i validate (required field) this select with jquery validation
plugin?

this code doesn't work:

$("#register_form").validate({
rules: {
dest_var: {
required: true;
}
}
});
}
From: Gregor Kofler on
Am 2010-08-05 16:22, Alpha Omega meinte:
> Hi,
>
> I have this multiple select:
>
> <select id="sel_dest" name="dest_var[]" multiple disabled="disabled"
> size="10">
> <option value="" selected>Destinatario</option>
> <option value="1"> .........
> </select>
>
>
> how can i validate (required field) this select with jquery validation
> plugin?
>
> this code doesn't work:
>
> $("#register_form").validate({
> rules: {
> dest_var: {
> required: true;
> }
> }
> });
> }

While I am not too familiar with the peculiarities of the mentioned
library (and I can't imagine why one needs a library for such simple
things), I'm pretty sure that the name of your element is "dest_var[]",
not just "dest_var".

Gregor


--
http://www.gregorkofler.com
From: Alpha Omega on
> While I am not too familiar with the peculiarities of the mentioned
> library (and I can't imagine why one needs a library for such simple
> things), I'm pretty sure that the name of your element is "dest_var[]",
> not just "dest_var".


I try dest_var[], but it didn't work. My code has problems on IE8...
From: rf on

"Alpha Omega" <alpha.omega1999(a)gmail.com> wrote in message
news:i3gcqo$38o$1(a)speranza.aioe.org...
>> While I am not too familiar with the peculiarities of the mentioned
>> library (and I can't imagine why one needs a library for such simple
>> things), I'm pretty sure that the name of your element is "dest_var[]",
>> not just "dest_var".
>
>
> I try dest_var[], but it didn't work.

Surely the error message you received was not "it didn't work".

> My code has problems on IE8...

What problems? Other than the use of JQuery to perform so trivial a task,
that is.