Results 1 to 2 of 2

Thread: Script run on combo

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Script run on combo

    I have a combo with 4 items on a form "form1".

    When the user choses the 4th item "item4" I want to trigger a messagebox and when the message box is closed I want to redirect the user to a different page.

    I wish to do this without the user submitting the form.

    Can anyone point me in the right direction. I no naff all about client side work (another thing to add to my To Do list).

    Thanks in Advance

    Parksie

  2. #2
    Addicted Member
    Join Date
    Jul 2002
    Location
    Brussels, Belgium
    Posts
    139
    I did something similar:

    <select class="quickl_homepage" onchange="goTo(this)">
    <option value="">Bank</option>
    <option value="">-------------------------------</option>
    <option value="sc.asp">a</option>
    <option value="lca.asp">b</option>
    <option value="Eur.asp">c</option>
    <option value="Eur2.asp">d</option>
    </select>


    and the javascript function:

    <script>
    function goTo(srcEl)
    {

    var temp
    temp = srcEl.options[srcEl.selectedIndex].value;
    srcEl.selectedIndex = 0;

    if (temp!='')
    {
    window.location.href = temp;
    }
    }
    </script>

Posting Permissions

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



Click Here to Expand Forum to Full Width