ASP.net下拉帮助 [英] ASP.net Dropdown Help
本文介绍了ASP.net下拉帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的aspx页面有一个下拉列表
我想在其上触发一个事件,以便如果其选择的索引为0,那么它将显示一个文本框
我想通过JavaScript做到这一点
I have a drop down in my aspx page
I want to trigger an event on it so that if its selected index is 0 then it shows a textbox
I want to do this through JavaScript
function do_Post(){
if(document.form1.dropdown.value!=0)
{
document.form1.submit();
}
}
如何使用JS在aspx中执行此操作?
我应该用什么代替document.form1.dropdown? document.getElementbyID?
How can i do this in aspx using JS??
what should i use instead of document.form1.dropdown? document.getElementbyID?? and how can i call it on aspx file??
推荐答案
Chris的这篇文章对如何做到这一点有一个非常简单明了的答案.
使用JavaScript处理下拉列表选择 [
This article by Chris has a very simple and clear answer on how to do this.
Using JavaScript to handle drop-down list selections[^]
^ ]
示例2 [
Example 1[^]
Example 2[^]
http://msdn.microsoft.com/en-us/library/aa479302 .aspx [^ ]
这篇关于ASP.net下拉帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文