ビデオヘルプ
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

作成: 08 Mar 2011 • 更新: 08 Mar 2011 | コメント数: 2
この問題は解決されました。 ソリューションを参照してください。

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. 

タグでディスカッションを検索:

コメント コメント数: 最新のコメントを表示

reecardo の写真

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

ソリューション
Aryanos の写真

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