Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question browser value return

    i have a html textbox, aside it i have put a <a href> tag which will open a new window.the new window displays a list values which has individual radio button.Last down the document there will be a button named choose.

    when i click the button the selected value should be filled in to the previous html text box


    please help

  • #2
    New Coder
    Join Date
    Aug 2004
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Here is the code....

    page1.html
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> Page 1 </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function doOpen(){
    WindowObjectReference = window.open("page2.html", "Page2",
    "menubar=no,location=no,resizable=yes,scrollbars=no,status=no");
    }
    //-->
    </SCRIPT>
    </HEAD>
    
    <BODY BGCOLOR="#FFFFFF">
    <input type="text" id="box1" value=""><a href="#" onclick="return doOpen();">Insert Value</a>
    </BODY>
    </HTML>

    page2.html
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> Page2 </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function doInsert(){
    	var radios=document.getElementById("myform").choice;
    	for(var i=0;i<radios.length;i++){
    		if(radios[i].checked) opener.document.getElementById("box1").value=radios[i].value;
    	}
    }
    //-->
    </SCRIPT>
    </HEAD>
    
    <BODY BGCOLOR="#FFFFFF">
    <form name="myform">
    <INPUT TYPE="radio" NAME="choice" value="Hello Good Morning."> Choice 1<br>
    <INPUT TYPE="radio" NAME="choice" value="Lets Go to Lunch."> Choice 2<br>
    <INPUT TYPE="radio" NAME="choice" value="Good Night Dear."> Choice 3<br>
    <INPUT TYPE="button" value="Choose" onclick="doInsert();">
    </form>
    </BODY>
    </HTML>
    Have fun

    Afru.


  •  

    Posting Permissions

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