Passing jQuery values Add New iframe window inputs

Support General Passing jQuery values Add New iframe window inputsResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42209
    jimimacjimimac
    Participant

    I have a relationship with the option to add add a new post checked.

    I've added the field on the frontend submission form and it works fine. I can select a post to create a relationship and I can add a new post to create a relationship.

    Adding a new post opens an iframe window for inputting the content into the new post. I'd like to pass jquery variables to the fields inside the iframe but it doesnt seem to be working.

    To test i tried changing the css on an elemnt inside the iframe but couldnt get that to work either.

    here's my code...

    
        $(document).ready(function() {
            
            $('#rwmb-modal-iframe').on('load', function() {
    
              $('#rwmb-modal-iframe').contents().find("#wpwrap").css("background-color", "red");
              
            });
        });
        
    #42229
    PeterPeter
    Moderator

    Hello,

    It's the customization code for your specific needs so it is beyond our scope of support. FYI, the iframe is not available on the page load, it is available when clicking on the button "Add New Post". You can listen to the body change to do stuff.

    For example:

    jQuery(document).ready(function($) {
        $('body').on('click', '.rwmb-post-add-button', function() {
          $('body').find('#rwmb-modal-iframe').on('load', function () {
          		$(this).contents().find("#wpwrap").css("background-color", "red");
          });
        });
    });
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.