Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Javascript to press a button after an item is selected from a drop down list

Created: 08 Mar 2011 • Updated: 08 Mar 2011 | 2 comments
This issue has been solved. See solution.

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. 

Comments 2 CommentsJump to latest comment

reecardo's picture

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

SOLUTION
Aryanos's picture

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.

I like my beats fast and my bass down low