Popup picker problems

javascript United States
  • 18 years ago

    Hi


    The problem is like this:
    I have a page called pop.html which stores several <input> fields.
    Eksampel:
    <input type=text name=menu1>
    <input type=text name=menu2>
    etc.


    For every <input> there is a button. When you click on the button a new window opens. This window list all pages from a given directory.
    Eksampel:
    page1.html
    page2.html
    page3.html
    ect.
    In the same window there is a button called "Item Select Item".


    So fare I can only make the script chose a page from window and put the name of the page in <input> field "menu". This is because the script saids:
    window.opener.document.form1.menu1.value = selvalue;


    How can a I make this script to chose for example page 2 and put it in <input> field 2???
    I don't know if I managed to write understandable, but hope so


    THIS IS THE CODE FOR LIST.HTML


    <SCRIPT LANGUAGE="JavaScript">


    <!-- Begin
    function sendValue(s){
    var selvalue = s.options[s.selectedIndex].value;
    window.opener.document.form1.menu1.value = selvalue;
    window.close();
    }
    //  End -->
    </script>


    </HEAD>


    <BODY>


    <form name=selectform>
    <select name=selectmenu size="8">
    <option value="page1.html">Page1.html
    <option value="page2.html">Page2.html
    <option value="page3.html">Page3.html
    </select>
    <p>
    <input type=button value="Item Select Item" onClick="sendValue(this.form.selectmenu);">
    </form>


    THIS IS THE CODE FOR POP.HTML


    <form name=form1>
       Menu1:
       <input type=text name=menu1> 
    <input type=button onClick="window.open('list.html','popuppage','width=250,height=200,top=100,left=100');" value="menu1"><br>
       Menu2:
       <input type=text name=menu2> 
    <input type=button onClick="window.open('list.html','popuppage','width=250,height=200,top=100,left=100');" value="menu2">
    </form>



Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray