SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Aug 2011
    0 Post(s)
    0 Thread(s)

    iframe button that adds a value to parent variable


    I am trying to write a script that allows a button in an iframe to change the value of a variable that is in the parent page. I then want to have an if statement in the parent that will change the url of the iframe ( or even change the url of the parent)

    Here's what I have for the parent:

    HTML Code:
    <iframe src="">
    <script type="text/javascript">
    var a=0
    function addToA () {
    if(a==1) {
    here's what I have for the iframe

    HTML Code:
    <div style=" position: absolute; left:80; top: 35;">
    <input type="button" onclick="parent.addToa()" value="Next">
    I figured this script should change the parent to the url, but it doesn't. Does anyone know what event I could use to change the iframe url? the parent url?

    Thanks again for all your help,
    Last edited by Mittineague; Aug 14, 2011 at 11:38. Reason: reformatting bbcode tags

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts