Try this (untested):

required: "#viaFornitura[selectedIndex=1]"

Jörn

On Mon, May 18, 2009 at 12:13 PM, ciupaz <luigi.zambe...@gmail.com> wrote:
>
> How can I make this Jorn?
>
> Luigi
>
> On May 18, 10:42 am, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
> wrote:
>> select-options don't have a checked property. You have to fix the
>> selector "#AltraVia:checked".
>>
>> Jörn
>>
>>
>>
>> On Mon, May 18, 2009 at 10:33 AM, ciupaz <luigi.zambe...@gmail.com> wrote:
>>
>> > Hi all,
>> > I have this validate code to validate a textbox if the user select a
>> > combo value:
>>
>> > <script type="text/javascript">
>>
>> >    $(document).ready(function() {
>> >                $("form#2form").validate({
>> >                rules: {
>> >                viaAltro: {
>> >                    required: "#AltraVia:checked"
>> >                }
>> >            },
>>
>> >            messages: {
>> >        viaAltro: {
>> >                    required: "Insert 'Altra via'"
>> >                }
>>
>> >            }
>> >        })
>> >    });
>> > </script>
>>
>> > and this is the HTML:
>>
>> > <select name="viaFornitura" id="viaFornitura">
>> >                <option>Seleziona la via</option>
>> >                 <option id="AltraVia">Altro</option>
>> > </select>
>>
>> > <label for="viaAltro">Altra via</label>
>> >        <input name="viaAltro" id="viaFornituraAltro" type="text" />
>>
>> > but it doesn't work.
>> > Where the problem?
>>
>> > Thanks a lot.
>>
>> > Luigi- Hide quoted text -
>>
>> - Show quoted text -

Reply via email to