Multiple Select validation with jquery

A

Alpha Omega

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;
}
}
});
}
 
G

Gregor Kofler

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
 
A

Alpha Omega

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...
 
R

rf

Alpha Omega said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top