www.webdeveloper.com
Results 1 to 3 of 3

Thread: How choose in a pop up window and the value be updated in the parent window

  1. #1
    Join Date
    Feb 2004
    Location
    Brasil porto Aelgre
    Posts
    544

    Smile How choose in a pop up window and the value be updated in the parent window

    Hi

    I hava a form with a select box named theme and need to open a window with a list of themes with each preview image and a button to choose the theme.

    Clicking on the button will close the pop-up and update the value of the theme select box

    How can it be done ?
    The button to open the window with themes is working fine
    <input type=button value="Choose theme" onClick=window.open("choosetheme.php","w","width=100,height=100") >

    But the problem is on the button to choose the theme it is not updating the value of the theme select box

    <input type=button name=themeselected value=$theme->name onCLick='parent.window.getElementById(\"theme\").value=".$theme->name.";'>

    Thank´s in advance

  2. #2
    Join Date
    Feb 2004
    Location
    Brasil porto Aelgre
    Posts
    544
    Hi

    Using this function still does not work

    function sendValue(s){
    alert(s);
    //var selvalue = s.value; //options[s.selectedIndex]
    window.opener.document.mform1.getElementById("theme").[selectedIndex] = s;
    window.self.close();
    }

    Inside a radio button i call : onClick='sendValue(this.value);' and does not work

    But using onClick='alert(this.value);' shows the right value

    What can it be ?

  3. #3
    Join Date
    Feb 2004
    Location
    Brasil porto Aelgre
    Posts
    544
    Now it is working:

    function sendValue(s){
    window.opener.document.getElementById("mform1").theme.selectedIndex = s;
    window.opener.document.getElementById("mform1").theme.text = s;
    window.opener.document.getElementById("mform1").theme.value = s;
    window.close();
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles