Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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!

share|improve this question
    
How is this not working? Any errors, warnings, strange behavior? The ID is correct? And it is an ID (and not a class)? –  t f 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
    
@One Trick Pony, that worked! thanks for the tip! –  Circle B Mar 11 '13 at 16:56
    
Posting answers as comments just results in cluttered comment threads... –  Chip Bennett Mar 12 '13 at 19:36
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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