jQuery submit will not submit using WordPress’ WP-user-frontend plugin

I am working on a WordPress project where my client has guest authors allowed to submit posts but are having trouble figuring out the WordPress Admin section and, in particular, how to embed YouTube videos in their posts. I added the wp-user-frontend plug-in which allows posts from WordPress’ front end. I added a custom field to the form and I am trying to intercept the submission of the form to concatenate the two values before the form submits.

I can alert the value of the textbox and the value of the textarea but when I try the concatenation, nothing happens.

Read More

Any help is greatly appreciated on the jQuery code below:

<script type="text/javascript">
    (function($){
        $('#wpuf_new_post_form').submit( function(){
            var value = $('#new-post-desc_ifr').contents().find('#tinymce').html();
            var tube = $('#cf_YouTube').val();
            var new_val = '';

            if( $.trim(tube).length) {
                new_val += value;
                new_val += '<br><iframe width="560" height="315" src="http://www.youtube.com/embed/';
                new_val += tube;
                new_val += '" frameborder="0" allowfullscreen></iframe>';
                $('#new-post-desc').val( new_val );
            } // end if

            return true;
        });
    })(jQuery); // END self-invoking anonymous function
    /*************************************************/
</script>

I edited the code to eliminate my STUPID error and now the form posts but it still posts the contents of the textarea and ignores the video code. Any ideas on what else is wrong beside the dumb php error???

Related posts

Leave a Reply

2 comments