Jump to content

Archived

This topic is now archived and is closed to further replies.

kharbat

appendChild Problem

Recommended Posts

[code]            var file = "<?php echo $file_dir; ?>";
            
            parent_form = window.parent.document.getElementById('Send_Form');
            hidden = parent.document.createElement("input");
            
            hidden.name = "attachment_"+id;
            hidden.id = "attachment_"+id;
            hidden.type = "hidden";
            hidden.value = file;
            
            parent_form.appendChild(hidden);
        </script>  [/code]

This is a part of the orginal code, this code exists in a page inside inline frame. It attempts to create a hidden field in the parent page. There is an error in the last line.. how can i solve it??!!
on firefox it tells me "parent_form has no properties"
thanks

Share this post


Link to post
Share on other sites
This worked find for me, just make sure all your variables are defined (like the id) and the form id in the parent window is 'Send_Form'

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.