Stevo
Stevo

Reputation: 2639

Remove dynamically created form elements using Jquery

I have this code which works:

return form.find('input[name!=user_view]').serializeArray();

but I'd like to now also omit another input box I have added, but I can't work out how to remove multiple elements.

So I'd like to do something like this:

return form.find('input[name!=user_view],input[name!=client_view]').serializeArray();

but it doesn't work.

What's the correct function/syntax?

Upvotes: 1

Views: 244

Answers (1)

thecodeparadox
thecodeparadox

Reputation: 87073

Try with this:

return form
          .find(':not(input[name=user_view],input[name=client_view])')
          .serializeArray();

Upvotes: 1

Related Questions