#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Aberdeen
    Posts
    3
    Rep Power
    0
    Hi,

    I have a simple pull down menu which displays a requested page in a frame .
    I also have 2 radio buttons which should let the user select which frame to
    display the page. I presume I need 'parent.radio1.location' instead of
    'parent.framename.location' but I can't access the radio1 value correctly.

    Many thanks for your help.

    Paul

    <SCRIPT LANGUAGE="JavaScript1.1">
    function team() {
    var list = document.forms[0].select
    parent.framename.location = list.options[list.selectedIndex].value
    }
    </SCRIPT>

    </HEAD>

    <BODY>

    <FORM>
    <SELECT NAME="select" onChange="team()">
    <OPTION SELECTED VALUE="blank.htm">--Select Team--

    <OPTION VALUE="page1.htm"> Page 1

    <OPTION VALUE="page2.htm"> Page 2

    </SELECT>

    <INPUT TYPE="RADIO" NAME="radio1" VALUE="left" CHECKED> Left Frame
    <INPUT TYPE="RADIO" NAME="radio1" VALUE="right"> Right Frame

    </FORM>

    </BODY>
    </HTML>

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Posts
    84
    Rep Power
    16
    Try this one:
    http://www.wsabstract.com/script/scr...ombomain.shtml

    for the checkbox thing just use a variable for the frame name..something like:

    framename = document.formname.checkboxname.value;
    parent.framename.location.href='page.html';

    Spookster

    [This message has been edited by Spookster (edited April 13, 2000).]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Aberdeen
    Posts
    3
    Rep Power
    0
    Thanks for help however....

    Tried it that way and took out alot of what I didn't think I need. But get this error -

    parent.targetframe has no properties

    Here is the code I'm using:

    <form name="choice">
    <select name="whichpage" size=1>
    <option value="page1.htm">Redz</option>
    <option value="page2.htm">Gers</option>
    </select>

    <input type="radio" name="radio1" value="left" checked> Left Frame
    <input type="radio" name="radio1" value="right"> Right Frame

    <input type="button" value="Go" onClick="doit()">

    </form>

    <script language="javascript">

    function doit(){

    var thebox=document.choice

    var targetframe=thebox.radio1.value;

    parent.targetframe.location=thebox.whichpage.options[thebox.whichpage.selectedIndex].value
    }

    </script>


    I'm obviously still not accessing the value in the radio button correctly. I look forward to your help.

    Many thanks

    Paul

Similar Threads

  1. Pass text box value from parent to child frame???
    By linhardt in forum HTML Programming
    Replies: 1
    Last Post: December 18th, 2003, 01:14 PM
  2. How do i get a form to check a text box on submit...
    By donpearson in forum PHP Development
    Replies: 24
    Last Post: December 11th, 2003, 07:02 PM
  3. auto refresh using check box
    By jazzman121 in forum HTML Programming
    Replies: 2
    Last Post: October 2nd, 2003, 02:30 PM
  4. checkbox assistance needed
    By linhardt in forum HTML Programming
    Replies: 6
    Last Post: October 2nd, 2003, 01:19 PM
  5. Auto populating a select box on another frame
    By Domisedon in forum HTML Programming
    Replies: 2
    Last Post: October 15th, 2002, 02:08 PM

IMN logo majestic logo threadwatch logo seochat tools logo