Dropdown When Changed Client Side Event

The dropdown field only supports client-side event handlers for On Field Entry and On Field Exit.  I'd like to execute a client-side script on a change, so it will need to be a hack.  If anyone has a solution, please pass it along.

Tagged:

Comments

  • Hi Rob

     

    Try this:

     

    $addHandler(
        $get("MyDropdownField"), 
        'change', 
        function()
        {
            // do something when the dropdown value changes...
            alert( "Dropdown changed!" );
        });
    

     

    Iain

  • Hi Iain,are you sure, it works? Shoul I run it on form load?

    This works for "click" event, but not work for "change" like in your example.

  • Hi Greg

     

    Apologies, my previous example only worked with Firefox.

     

    This should work with both browsers (tested with Firefox 11 and IE 8)

     

    $addHandler(
        $find('MyDropdownField').radComboBox.get_inputDomElement(), 
        'change', 
        function()
        {
            // do something when the dropdown value changes...
            alert( 'Dropdown changed!' );
        });
    

     

    Thanks

     

    Iain

  • Seems like this isn't working for me.  It doesn't seem to like the argument

     

    $find('MyDropdownField').radComboBox.get_inputDomE​lement(),

     

    I'm on IE9 using BPM v9.1.2.1.  What version of BPM are you using?

  • I'm also using 9.1.2.1

     

    I've attached the sample that works for me on IE 8 (in compatibility mode) and Firefox 11

  • Wow!  That was annoying.  When I copy and paste from your solution it works like a charm, but when I do so from your post that gives an 'invalid character' error when loading the script.  Evidently, there is a hidden character between 'E' and 'l' in '

    get_inputDomElement' of your original post.