新手求教一个简单的JS有关问题
新手求教一个简单的JS问题
我不知道为什么我一选择就提醒我 if ($("ttt").value == "样机")对象缺失,求大神指点
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" ValidateRequest="false" Inherits="test._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type="text/javascript">
function getYangJiInfo(obj) {
if ($("ttt").value == "样机") {
alert("请填写公司型号");
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>test</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="ttt" runat="server" onchange="getYangJiInfo(this);"
>
<asp:ListItem Value="样机1">样机1</asp:ListItem>
<asp:ListItem>样机2</asp:ListItem>
<asp:ListItem>样机3</asp:ListItem>
<asp:ListItem>样机</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="公司型号" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
我不知道为什么我一选择就提醒我 if ($("ttt").value == "样机")对象缺失,求大神指点
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" ValidateRequest="false" Inherits="test._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type="text/javascript">
function getYangJiInfo(obj) {
if ($("ttt").value == "样机") {
alert("请填写公司型号");
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>test</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="ttt" runat="server" onchange="getYangJiInfo(this);"
>
<asp:ListItem Value="样机1">样机1</asp:ListItem>
<asp:ListItem>样机2</asp:ListItem>
<asp:ListItem>样机3</asp:ListItem>
<asp:ListItem>样机</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="公司型号" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
- 1小弟我有一共享打开数据库类,第一次打开时没有异常,以后打开就出现异常,请教高手怎样纠正,多谢
- 2大三在校生的传智120天的1200小时.net(十三)关于Response.Redirect跟Server.Execute的区别
- 3ajax异步登陆页面无法跳转解决办法
- 4web api怎么显示序列化datatable
- 5Dapper小型ORM的使用(任意吐槽下公司)
- 6如何将部门和子部门在一个listbox中显示
- 7替年度评选活动添加倒计时功能
- 8asp.net word操作有关问题
- 9net 调用oracle存储过程(PLS-00306),该怎么解决
- 10项目中摘引CodeSmith相关的DLL
- 上一篇:,绑定CHECKOBX
- 下一篇:疼的领悟~
文章评论
相关解决方案