Someone helped me find JavaScript code to remove hidden form fields from submission and code that ignores a certain field that I don’t want removed (whether it’s hidden or not):
$("form").submit(function() {
$(this).find(":hidden").remove(); // hide hidden elements before submitting
});
and
:not(input[name=csrfmiddlewaretoken])
However, I can’t for the life of me figure out how to put these together. I’m sure it’s a basic JavaScript question, but I can’t seem to piece these together.
Does anyone know how to remove all hidden form entries not named csrfmiddlewaretoken? If you do, I’d really appreciate it.
Thanks a lot.
Or
Or