Trying to submit a field value from a popup modal window to my WordPress parent window meta-box.

On my add post page I have a metabox with a field type 'text'.


The id of my 'text' field type input is 'tumble2_kaltura-video'

Next to the metabox text field is a button link which opens up a modal box:

Kaltura popup window

Once I select my video in the modal box, there is a submit button that when clicked will send out a shortcode. Normally this shortcode is sent to the wp-editor

shortcode output to editor What script do I need to use in order to send the shortcode from the modal box to the metabox text field 'tumble2_kaltura-video'?

Here is my kaltura code that is 'in charge' of normally sending the value to the editor. Need to change something in here to target my metabox instead.


I tried pasting my code in here instead of gist, but no matter how I formatted it, it was always messed up.

1 Answer 1


Use the parent method to pass data back to your meta field.

Create a JS function to handle the passing of data from Thickbox to the meta field:

function foo_interstitial(data){

Add a submit handler to your thickbox instance that passes to the parent.foo_interstitial() function.

    var _value_to_pass = $('.field-to-pass-selector').val();
  • Hi Brian: I have cut everything down to what I believe is the relevant code: gist.github.com/3162415 the first snippet is in the iframe popup, the second is the parent window with the input area I am trying to populate when the iframe submit button is clicked, the 3rd is the 'value' hat is being passed along with what I think you wanted me to do..... can you see what I am doing wrong there? b.t.w. thanks for the help
    – shawn
    Jul 23, 2012 at 7:32
  • WOW, just read your profile.. Totally cool! Something you'll like to hear... this little script is to actually integrate the kaltura video server into our church website for streaming our sermons. I've been on this for days, just prayed about it again a few hrs ago, and here you come along to help... Amazing!
    – shawn
    Jul 23, 2012 at 7:45
  • :) Cool. Add the second bit of code to the markup of modal-form.php and see if that works for you :) Jul 23, 2012 at 13:44
  • Hi Brian, I added the jQuery 3rd snippet to the modal-form.php and when clicking the submit button, it is not populating the value to the parent window input. Not sure how to troubleshoot it to see what it is actually doing. If I send you link/login would you be able to tell what is wrong by looking?
    – shawn
    Jul 24, 2012 at 1:10
  • @shawn Contact me via my website and we'll post the results here. Jul 24, 2012 at 1:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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