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 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    22
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question select + window element

    I want to create a link (<a>) that enables me to send the value of select box with name "test" to a popup window using the header.

    for exaple: select box has the value "here". When i click on the link a window opens using "pop-up.html?test=here".

    I cant seem to find a tuturial or topic that describes my problem.

    I any of u can help me it will be mutch aprisiated.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Code:
    function openPopup(target){
      var w=window.open("", target, "width=600,  height=400, resizable=1");
      w.focus();
      return true;
    }
    Code:
    <form name="frm" action="pop-up.html" method="get" target="popup" onsubmit="return openPopup(this.target)">
    <select name="test">
    <option value="blah">This is blah</option>
    <option value="foo">This is foo</option>
    </select>
    <a href="#" onclick="document.frm.submit(); return false;">Open</a>
    </form>

  • #3
    New Coder
    Join Date
    Aug 2002
    Posts
    22
    Thanks
    1
    Thanked 0 Times in 0 Posts

    re

    I dont want to submit the form i only want to grab the selectbox value to display some additional information.

    I tried:

    <a onclick="window.open("", target+document.frm.test, "width=600, height=400, resizable=1");">+</a>
    But it doest work correctly yet
    Last edited by ramli; 06-12-2007 at 11:42 PM.

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Code:
    function openPopup(){
      var param = "?test=" + document.frm.test.value;
      var w = window.open("pop-up.html" + param, "popup", "width=600,  height=400, resizable=1");
      w.focus();
      return false;
    }
    Code:
    <form name="frm">
    <select name="test">
    <option value="blah">This is blah</option>
    <option value="foo">This is foo</option>
    </select>
    <a href="#" onclick="return openPopup();">More Info</a>
    </form>

  • #5
    New Coder
    Join Date
    Aug 2002
    Posts
    22
    Thanks
    1
    Thanked 0 Times in 0 Posts

    re

    Thax that works


  •  

    Posting Permissions

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