Workflow Soluiton

 View Only
  • 1.  Javascript to press a button after an item is selected from a drop down list

    Posted Mar 08, 2011 12:11 PM

    I was wondering if anyone has built a project or knows how to use javascript to press a button after an item has been selected from a drop down list. I have a form that has a drop down and various text boxes. When a person selects an item from the drop down, a button is needed to leave the form and populate the text boxes in order to display the related information. What I'm trying to do is eliminate the need for the user to have to press the button and have the javascript press the button automatically but haven't gotten it to work so far. Any help would be greatly appreciated. 



  • 2.  RE: Javascript to press a button after an item is selected from a drop down list
    Best Answer

    Posted Mar 08, 2011 12:54 PM

    1. Make the Control ID of the button "woohoo" (no dbl quotes)

    2. For the DropDownList, add a AttributeKeyValuePair custom event to the Custom Events in Functionality / Behavior

    Make the event onpropertychange, and add the event handler script as follows:

    //BEGIN

    var button = document.getElementById('woohoo');

    button.click();

    //END

    OnPropertyChange seens a little steep, but it was the only good event I could find



  • 3.  RE: Javascript to press a button after an item is selected from a drop down list

    Posted Mar 08, 2011 01:13 PM

    Thanks reecardo, that was exactly what I was looking for. Doing research most sites were using the onchange event handler but I couldn't find it on the list.