Support » Plugins » How to insert into post content from popup

  • I created a button that appears in the post editor in html mode.

    The button opens a new window with a form containing info from the database in a single textarea.

    How do I transfer the data from that child window to the parent post.content?

    I have tried normal javascript functions that work as standalones but, there is something with the editor in WordPress that is preventing the javascript in the child from inserting into the post form content area, I think.

    Does anyone know how to do that? Maybe suggest a simple plugin that I can dissect to find out how?

    Thanks for your help…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ok, I figured it out. I also figured out I need some sleep… I was serving the pop up from a different cpanel account… duh..sorry.

    <script langauge="javascript">
    function insertInPost(formguts) {
    // IE support
    if ( {;
    sel =;
    sel.text = formguts;
    // MOZILLA/NETSCAPE support
    else if ( || == 0) {
    var startPos =;
    var endPos =; =, startPos) + formguts +,;
    else { += formguts;
    <a href="#" onclick="insertInPost('thiswillbeformgutsfromform')">Is This Thing On?</a>

    Puts data after cursor position in post.content’s textarea…

    Any sterilization and other additions are welcome.

    Do you think it is possible to put data into other inputs or textareas, like the excerpt? Trying to find some documentation for this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to insert into post content from popup’ is closed to new replies.