You need to quote the full key, eg "name['name']": "required". See
http://docs.jquery.com/Plugins/Validation#Fields_with_complex_names_.28brackets.2C_dots.29

Jörn

On Fri, May 22, 2009 at 10:15 PM, Bob O <bhan...@hcinsight.com> wrote:
>
> so as not to confuse..
>
> the name attribute looks like this
> name="name['name']" for the input field
>
> and the js is
>
> rules: {
>  name['name']: 'required'
> }
>
> i noticed typos in the above question.
>
>
>
> On May 22, 12:36 pm, "bhan...@hcinsight.com" <bhan...@hcinsight.com>
> wrote:
>> Can anyone tell me how i can change which attribute on my form field
>> triggers the validation?
>>
>> currently it appears the be the name attribute. So in my Rails app
>> using Rails helpers, it sets the name to somthing like formname
>> ['fieldname'] and the whole name.
>>
>> in my script if i do something like
>>
>> rules: {
>>   formname['fieldname]: 'required'
>>
>> }
>>
>> etc....it causes the script to break.
>>
>> I need a workaround if anyone has ever come across this problem..
>>
>> Thanks in Advance
>

Reply via email to