如何提醒其他ASP LISTITEMS [英] How to Alert other ASP LISTITEMS

查看:56
本文介绍了如何提醒其他ASP LISTITEMS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下脚本,每次从下拉菜单中选择语言时我都需要运行警报,当西班牙语被选中时,我能够发出警报(值:es),但我无法运行其他通过添加相同的脚本语言提醒,只有西班牙语会提醒 -





这是脚本:



< asp:DropDownList ID =aicLanguageonchange =dropDownListOnChange(this); runat =servername =aicLanguageEnabled =True>

< asp:ListItem Value =slText =Select Language>

< asp:ListItem Value =enText =English>

< asp:ListItem Value =mnText =Chinese>

< asp:ListItem Value =jaText =Japanese>

< asp:ListItem Value =ptText =Portuguese>

< asp:ListItem Value =esText =Spanish>

< asp:ListItem Value =deText =German>











< script type ='text / javascript '>



var dropdown = document.getElementById(aicLanguage);

dropdown.onchange = function(event){

if(dropdown.value ==es){

alert(SPANISH SCHEDULE)



}

}





< / script>

I have the following script , I need to run alert each time a language is selected from the dropdown menu , I was able to alert it when spanish is selecte (value: es) , but I was not able to run the other languages alerts by adding the same scripts , only spanish will alert-


Here is the script:

<asp:DropDownList ID="aicLanguage" onchange="dropDownListOnChange(this);" runat="server" name="aicLanguage" Enabled="True">
<asp:ListItem Value="sl" Text="Select Language">
<asp:ListItem Value="en" Text="English">
<asp:ListItem Value="mn" Text="Chinese">
<asp:ListItem Value="ja" Text="Japanese">
<asp:ListItem Value="pt" Text="Portuguese">
<asp:ListItem Value="es" Text="Spanish">
<asp:ListItem Value="de" Text="German">





<script type='text/javascript'>

var dropdown = document.getElementById("aicLanguage");
dropdown.onchange = function (event) {
if (dropdown.value == "es") {
alert(" SPANISH SCHEDULE")

}
}


</script>

推荐答案

使用否则如果



http://www.w3schools。 com / js / js_if_else.asp [ ^ ]



另外请花点时间至少学习编码的基础知识。这是一个浪费你的时间和我们的问题,在你开始尝试编写实际代码之前,对语言的理解是最低限度的。询问每一个小问题都不是一种有效的学习方法。
Use "else if"

http://www.w3schools.com/js/js_if_else.asp[^]

Also please take time to at least learn the basics of coding. It's a waste of your time and ours to ask such basic questions as this, a decent understanding of the language in general is a bare minimum before you start trying to write actual code. Asking about every little question is not an efficient way to learn.


这篇关于如何提醒其他ASP LISTITEMS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆