LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   javascript - submit an iframe form (http://www.linuxquestions.org/questions/programming-9/javascript-submit-an-iframe-form-486311/)

AM1SHFURN1TURE 09-23-2006 02:26 PM

javascript - submit an iframe form
 
i have been trying

<iframe id="fid" name="fname" src="http://www.google.com/"></iframe>
<script>

function submitForm(){

window.frames[0].document.forms[0].submit();


}

<input type="submit" value="try" name="button"
onclick="submitForm();">
</script>


and it will not do a thing, I have also tried several other ways to do this - and other people say it works for them, but not for me. I tried both IE and firefox.

95se 09-23-2006 05:51 PM

Any reasonable browser shouldn't give you access to the iframe. That's probably your problem. They do this to prevent cross site scripting attacks. Check out Wikipedia to find out why allowing access is bad.

Note: I just checked MS's docs, and they say they allow it as long as it's in the same domain. Since I'm guessing you don't work for google, the above applies.


All times are GMT -5. The time now is 08:48 PM.