How to add enctype to multipart/form-data to comment form?

I need a way to change the encoding type for my comment form, without hacking the core files.

I’m aware of the function to work on the post editing form: post_edit_form_tag.

I’ve tried this:

jQuery('#comment_form').attr("enctype","multipart/form-data");

But it doesn’t work, the only next step I know of is to hack the source code…
Any help would be very much appreciated—thanks in advance!

1 Answer
1

One Trick Pony answered the question, here’s his solution:

jQuery('#comment_form')[0].encoding = 'multipart/form-data';

And here’s a jsFiddle of it.

Leave a Comment