1

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!

  • How is this not working? Any errors, warnings, strange behavior? The ID is correct? And it is an ID (and not a class)? – tfrommen Mar 11 '13 at 14:58
  • @t f, It's just not doing anything, I'm using an id and it is correct... – Circle B Mar 11 '13 at 16:50
  • Posting answers as comments just results in cluttered comment threads... – Chip Bennett Mar 12 '13 at 19:36
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.