views:

31

answers:

2

i am trying to validate my form fields calling the input text ids, but jquery is not validating it. here is what i have:

email2: {// compound rule required: true, email: true
},

if i change name="email2" it works fine, but i want name="email[]" as i have an array of email that i am getting from user. so then, i gave my input text and id for jquery to validate but it doesnt validate, any ideas?

+1  A: 

The rules are meant to be keyed by name, not id.

Something like this might work for you...

$("#form").validate({
    rules: {
        "email[]" : { /* compound rule */ }
    }
});
BBonifield
ah, now i know why it didn't work. ok thanks. i will try that.
Menew
A: 

ok so i changed it to: i can't get php to get the values for id=email[] any thoughts?

Menew