jQuery: form serialize, hidden fields, and not displayed fields
问题 I am using $(this).serialize() when submitting a form. It works well, except in times when I (for some reason) have 2 fields with same name (one visible, and one not, and I am not talking about type="visible" but display:none )... But of course serialize has no regard for this... it just takes them all. I tried this var $disabled_list = $(this).find('input:hidden,select:hidden,textarea:hidden').attr('disabled', 'disabled'); $(this).serialize(); $disabled_list.attr('disabled',''); and It is