This will work without security problems if the iframe is in the same domain as the main page. Replace document with the id of the iframe and you can target it easily.
For instance if the id of the input in the Iframe is "box", and the id of the iframe is "theframe"... use this:
Code:
theframe.getElementById("box").value = "v7n ftw";