SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Australia
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    popup win from dropdown form

    Hello, hope somebody can help me.

    Can we actually have a pop up new window from dropdown menu form with specific window size that we want?

    If it can be done, please help me

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.sitepointforums.com/showt...threadid=45344

    That thread is covering this exact topic to adjust the size of the window simply change one thing in the script that weird has

    Code:
    function formHandler1(frequent) {
    var URL = document.frequent.site1.options[document.frequent.site1.selectedIndex].value;
    window.open(URL);
    
    }
    That is the function he already offers but this will change the size.

    Code:
    function formHandler1(frequent) {
    var URL = document.frequent.site1.options[document.frequent.site1.selectedIndex].value;
    window.open(URL,'','width=100px,height=100px');
    }
    Hope that helps
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Australia
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you maelstorm

    here's the code that i used

    <script language="javascript">
    <!--

    function load1(form) {
    var url= form.webs.options[form.webs.selectedIndex].value;
    if (url !='') open(url);
    return false;

    }
    </script>

    </head>

    <body bgcolor="#FFFFFF" text="#000000">



    <form name="menu1">
    <select name="webs" onChange="load1(this.form)">
    <option selected> websites </option>
    <option value="web1.htm">Web one </option>
    <option value="web2.htm">web two </option>
    <option value"web3.htm">web three </option>


    ---- - ---
    is it possile for each *.htm to be opened in new window with its specific size?

    plz help
    Last edited by mojomaru; Jan 11, 2002 at 00:05.

  4. #4
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by mojomaru
    [B]thank you maelstorm

    here's the code that i used

    <script language="javascript">
    <!--

    function load1(form) {
    var url= form.webs.options[form.webs.selectedIndex].value;
    if (url !='') open(url);
    return false;

    }
    </script>

    </head>
    In this function

    Code:
    if (url != ''){
       if (url == "web1.htm"){
           var newwin=window.open(url,'','width=350px,height=350px');
       }else if(url == "web2.htm"){
          var newwin=window.open(url,'','width=350px,height=350px');
       }else if ...
    }
    Thats the only way I can think of doing it. Sorry. But that will do what you want.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Australia
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the code

    but where should i put those?

  6. #6
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by mojomaru
    Thanks for the code

    but where should i put those?
    Code:
    <script language="javascript"> 
    <!-- 
    
    function load1(form) { 
    var url= form.webs.options[form.webs.selectedIndex].value; 
    if (url != ''){
       if (url == "web1.htm"){
           var newwin=window.open(url,'','width=350px,height=350px');
       }else if(url == "web2.htm"){
          var newwin=window.open(url,'','width=350px,height=350px');
       }else if ...
    }
    
    
    } 
    </script>
    Right there.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.


Bookmarks

Posting Permissions

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