jQuery 弹出模态窗口后我如何 能让jQuery获取的模态窗口里的属性进行判断
例如
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<link rel="stylesheet" href="themes/main.css" type="text/css" />
<link rel="Shortcut Icon" href="img/Leicester-City-256x256.ico">
<!--tipswindown插件样式-->
<link rel="stylesheet" href="themes/tipswindown.css" type="text/css" />
<script src="jsa/jquery.min.js" type="text/javascript"></script>
<script src="jsa/tipswindown.js" type="text/javascript">//tipswindown插件</script>
<script src="jsa/jq-main.js" type="text/javascript"></script>
</head> <button id="id1">点击我弹出提示</button>
<div id="testID" style="display: none">
<table>
<tr>
<td><input type="text" id="name" /></td>
<td><input type="text" id="pass" /></td>
<input type="button" value="验证"/>
</tr>
</table>
</div>
</li>
当我单击按钮Button的时候将会弹出个窗口里面包含着 两个文本框 我该如何去写才能验证两个文本框不能为空呢?
例如
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<link rel="stylesheet" href="themes/main.css" type="text/css" />
<link rel="Shortcut Icon" href="img/Leicester-City-256x256.ico">
<!--tipswindown插件样式-->
<link rel="stylesheet" href="themes/tipswindown.css" type="text/css" />
<script src="jsa/jquery.min.js" type="text/javascript"></script>
<script src="jsa/tipswindown.js" type="text/javascript">//tipswindown插件</script>
<script src="jsa/jq-main.js" type="text/javascript"></script>
</head> <button id="id1">点击我弹出提示</button>
<div id="testID" style="display: none">
<table>
<tr>
<td><input type="text" id="name" /></td>
<td><input type="text" id="pass" /></td>
<input type="button" value="验证"/>
</tr>
</table>
</div>
</li>
当我单击按钮Button的时候将会弹出个窗口里面包含着 两个文本框 我该如何去写才能验证两个文本框不能为空呢?
$("input[type=\"button\"]:eq(0)").click(function() {//第几个按钮
//var str="";
$("input[type=\"text\"]").each(function(index, value) {
if (value.value == "") {
alert("不能为空");
value.focus();
return;
}
//str += "<value" + index + ">" + value.value + "</value" + index + ">";
});
});
$(function(){
$("input[type=\"button\"]:eq(0)").click(function() {//第几个按钮
//var str="";
$("input[type=\"text\"]").each(function(index, value) {
if (value.value == "") {
alert("不能为空");
value.focus();
return;
}
//str += "<value" + index + ">" + value.value + "</value" + index + ">";
});
});});
$("input[type=\"button\"]:eq(0)").click(function() {//第几个按钮
//var str="";
$("input[type=\"text\"]").each(function(index, value) {
if (value.value == "") {
alert("不能为空");
value.focus();
return;
}
//str += "<value" + index + ">" + value.value + "</value" + index + ">";
});
});}
$(function(){clk();});
///加载后再调用
只会这样了
if(v==true)
{
$.get("chalidindex.aspx", { mid:ajaxs.sysid,id:mid,mname:mname,mtaix:mtaix,murl:murl, msg:'update',time:new Date() },
function(data){
$("#msg").html("");
$("#msg").html(data);
});
这样子的通过id应该直接就取到了啊弹出的模态窗口验证的话,在弹出页面里写js验证就可以了