How to not serialize a given element type with jQuery

4

I have a form and I do not want to "serialize" the input's type of checkbox , so I tried some options such as below:

var form = $('#service-item-form :not(:input[type="checkbox"])').serialize();

But unfortunately it does not work! I would like to know what I can try to do to resolve this issue.

    
asked by anonymous 19.11.2015 / 16:51

2 answers

2

According to the response from SOEN :

$('#ofform').on('submit', function(e) {
    e.preventDefault();
    var serializedReturn = $('input[name!=security]', this).serialize();        
});

I would prefer this way, using not :

$("form").find(":input").not(':checkbox').serialize()
    
19.11.2015 / 17:02
4

Try the following:

var form = $('#service-item-form')
    .find('input, textarea, select')
    .not(':checkbox')
    .serialize()
    
19.11.2015 / 16:59