Jump to content


Photo

appendChild Problem


  • Please log in to reply
1 reply to this topic

#1 kharbat

kharbat
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 19 June 2006 - 12:48 PM

            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>  

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

#2 nogray

nogray
  • Members
  • PipPipPip
  • Advanced Member
  • 930 posts
  • LocationSan Francisco CA

Posted 20 June 2006 - 04:49 PM

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'

NoGray.com





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users