Hi,
I'm currently trying to write a custom tinyMCE plugin for WordPress and I have a problem:
I open a new editor window (iframe) with the following code:
editor.windowManager.open( {
url: 'http://127.0.0.1/wordpress/wp-content/plugins/teachpress/admin/document_manager.php?post_id=1003',
title: 'teachPress Document Manager',
id: 'tp_document_manager',
inline: 1,
width: 950,
height: 560,
buttons: [
{
text: 'Insert',
onclick: function(){
// How can I access to the values of the checkboxes in the iframe here?
}
},
{
text: 'Close',
onclick: 'close'
}
]
});
In the opened iframe I have some checkboxes:
[...]
<iframe src="http://127.0.0.1/wordpress/wp-content/plugins/teachpress/admin/document_manager.php?post_id=1003" tabindex="-1">
[...]
<form method="post">
<input type="checkbox" name="tp_file_checkbox[]" id="tp_file_checkbox_11" class="tp_file_checkbox" value="11">
<input type="checkbox" name="tp_file_checkbox[]" id="tp_file_checkbox_12" class="tp_file_checkbox" value="12">
[...]
</form>
</iframe>
[...]
And here I have no idea how I can read the values from the checkboxes within the function for the insert button.
I've tried it with:
jQuery(".tp_file_checkbox")
But jQuery does not find any element and unfortunately tinyMCE sets no name or id for the iframe (only for the parent DIV of the iframe).
Has anyone an idea how can I read the values from the checkboxes?