[jQuery] Re: Problem with radio/checkboxes on ajax post

2007-12-05 Thread e2e
Thank you... On Dec 5, 1:39 am, Wizzud <[EMAIL PROTECTED]> wrote: > You could try... > > $(':input',this).each(function(){ > var me = $(this); > if(!me.is(':checkbox, :radio') || this.checked){ > inputs.push(this.name + '=' + unescape(me.val())); > } > }); > > On Dec 4, 8:44 a

[jQuery] Re: Problem with radio/checkboxes on ajax post

2007-12-04 Thread Wizzud
You could try... $(':input',this).each(function(){ var me = $(this); if(!me.is(':checkbox, :radio') || this.checked){ inputs.push(this.name + '=' + unescape(me.val())); } }); On Dec 4, 8:44 am, e2e <[EMAIL PROTECTED]> wrote: > Changing my function to this solved my problem: >

[jQuery] Re: Problem with radio/checkboxes on ajax post

2007-12-04 Thread e2e
On Dec 4, 1:20 am, Wizzud <[EMAIL PROTECTED]> wrote: > That would be because your $(':input', this) selector is selecting > *every* input field in your form and adding it to your inputs array. > One solution is to put a test in your each() function to see if the > field is a checkbox or radio, and

[jQuery] Re: Problem with radio/checkboxes on ajax post

2007-12-04 Thread e2e
Changing my function to this solved my problem: $("form#profile_form").submit(function() { $("#users_profile h1").after(''); $("#users_profile .errors").remove() var inputs = []; $(':input', this).each(function() {

[jQuery] Re: Problem with radio/checkboxes on ajax post

2007-12-03 Thread Wizzud
That would be because your $(':input', this) selector is selecting *every* input field in your form and adding it to your inputs array. One solution is to put a test in your each() function to see if the field is a checkbox or radio, and if it is, only add it to your inputs array if it's checked.