Results 1 to 4 of 4

Thread: similat to onchange

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254
    Hi,
    can anyone tell me if there is an event fired when the contents of a list box change. I don't think onchange is the required event: MS says:

    This event is fired when the contents are committed and not while the value is changing. For example, on a text box, this event is not fired while the user is typing, but rather when the user commits the change by leaving the text box that has focus.

    I have a list box which automatically matches a partial string as it is typed in a text box with its nearest full string in the list box. So as someone is typing the selected item in the text box changes. I need the method ( if one exists ) which is when when the contents change AND gfocus is not lost.

    Any help greatly appreciated.

    Lenin.

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    That is true enough for a text box but onchange works as expected for a SELECT tag/list box.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254
    Monte, I tried the following:

    <SELECT NAME="TownCombo" width=5 size="1" onChange="BuildList(this);">


    <SCRIPT Language="JavaScript">
    // Dynamic Town List
    function BuildList(num)
    {
    alert("OH");
    }

    </Script>


    The listbox does not have focus, but the contents continually changed based on my input to a textbox doing the match.

    Let me know your thoughts.

    Lenin.


  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Wait. I just re-read your question.

    If you mean when you add or remove option elements from the select element, then no there is no event for that. There is no event for that.

    If you mean when the selected item changes, then onchange works.

    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

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