Modify ↓
Ticket #4523 (closed bug: invalid)
:input selector doesn't work for checkboxes
| Reported by: | allspiritseve | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.3.2 |
| Component: | unfiled | Version: | 1.3.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I'm submitting a form through ajax, using :input to grab all the form values. However, it is not distinguishing whether checkboxes have been checked or not... it just grabs the value anyways.
Change History
comment:2 Changed 4 years ago by dmethvin
- Status changed from new to closed
- Resolution set to invalid
The value property of a checkbox (which you are getting indirectly) is the same whether its checked attribute/property is set or not.
If you want the values of all the form elements as they would have been if you submitted the form, look at the formSerialize method in the Forms plugin.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Here's what I'm using, if that helps at all:
$(document).ready(function() {
});