I am using JQuery's thickbox to input form data. Would like to auto close the thickbox and send a variable back to the parent from the thickbox form input upon submit.
Depending on how you're showing the Thickbox popup, there are going to be different ways to accomplish what you want.
If you're using an IFRAME popup, there is no way (that I know of) to pass the value back to the parent.
If you're using inline content (what I would suggest for this purpose), the value will still be available to you after Thickbox hides the inline content. You can then use jQuery to access the fields that the user filled in.
You can send data back to the parent with an iframe thickbox:
On your parent, you can write a function to handle this data:
function new_info(from_form) {
$('#thing).text(from_form);
}
Then simply call this function in your submit function (or whereever) from the iframe page using parent:
$('#myForm').submit(function(){
parent.new_info($('#phone_number').val());
});
Here is an awesome article Upload in modal window and pass values with jQuery.
Big thanks for author. It saved me pretty amount of time.