SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Select menu pop-up

    Hey,
    I have this select menu
    PHP Code:
    <select name='config'>
    <
    option value='cal' selected='selected'>Choose a server config</option>
    <
    option value='cal'>Official CAL Match</option>
    <
    option value='clanbase'>Clanbase time 20 (FF-ON)</option>
    <
    option value='clanbasemr12'>Clanbase MR12 (FF-ON)</option>
    <
    option value='ogl_Advanced_v2'>OGL CS Advanced Server Config V2.0</option>
    <
    option value='ogl_ff_v2'>OGL CS FF Server Config V2.0</option>
    <
    option value='ogl_v2'>OGL CS Server Config V2.0</option>
    <
    option value='pg'>Official ProvingGrounds Server Config</option>
    <
    option value='Public'>PUBLIC Settings</option>
    </
    select
    and I want to make it so when they make a selection, it pops up a window to tell them a little about what settings that config has.

    Thanks

  2. #2
    SitePoint Evangelist
    Join Date
    Nov 2002
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Use onchange event

    DJ P@CkMaN,

    You can use onchange event like this:

    <select name='config' onchange='showInfo(this)'>
    <option value='cal' selected='selected'>Choose a server config</option>
    <option value='cal'>Official CAL Match</option>
    <option value='clanbase'>Clanbase time 20 (FF-ON)</option>
    <option value='clanbasemr12'>Clanbase MR12 (FF-ON)</option>
    <option value='ogl_Advanced_v2'>OGL CS Advanced Server Config V2.0</option>
    <option value='ogl_ff_v2'>OGL CS FF Server Config V2.0</option>
    <option value='ogl_v2'>OGL CS Server Config V2.0</option>
    <option value='pg'>Official ProvingGrounds Server Config</option>
    <option value='Public'>PUBLIC Settings</option>
    </select>

    <script language="javascript">
    function showInfo(objSelect){
    var newWin = window.open("http://your-web-site-url/showInfo.php?config=" + objSelect[objSelect.selectedIndex].value);
    }
    </script>

    I hope this helps.


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
  •