弹出层如何获取表单数据
发布网友
发布时间:2022-04-26 07:31
我来回答
共2个回答
热心网友
时间:2022-04-24 11:05
代码很长:
<link href="http://www.dazhongw.com/css/css.css" rel="stylesheet" type="text/css" />
<SCRIPT src="http://www.dazhongw.com/js/jquery.min.js"></SCRIPT>
<script language="javascript" type="text/javascript">
function showDiv(){
$("#zxgs").attr('value',$("#gsmc").text());
$("#ly").attr('value',$("#xxly").text());
document.getElementById('popDiv').style.display='block';
document.getElementById('popIframe').style.display='block';
document.getElementById('bg').style.display='block';
}
function closeDiv(){
document.getElementById('popDiv').style.display='none';
document.getElementById('bg').style.display='none';
document.getElementById('popIframe').style.display='none';
}
</script>
<script language="javascript">
function checkkey(){
if(form2.realname.value=='请填写您的真实姓名')
{
alert("请填写您的真实姓名!");
form2.realname.focus();
return false;
}
if(form2.mobile.value=='请输入您的手机号')
{
alert("请输入您的手机号!");
form2.mobile.focus();
return false;
}
return true;
}
</script>
<script language="javascript">
function clearDefaultText2(el2, message2) {
var obj2 = el2;
if (typeof (el2) == "string")
obj2 = document.getElementById("mobile");
if (obj2.value == message2) {
obj2.value = "";
}
obj2.onblur = function() {
if (obj2.value == "") {
obj2.value = message2;
}
}
}
</script>
<script language="javascript">
function clearDefaultText(el, message) {
var obj = el;
if (typeof (el) == "string")
obj = document.getElementById("realname");
if (obj.value == message) {
obj.value = "";
}
obj.onblur = function() {
if (obj.value == "") {
obj.value = message;
}
}
}
</script>
<div id="popDiv" class="mydiv" style="display:none;">
<h4><span>免费预约</span><a href="javascript:closeDiv()">X 关闭</a></h4>
王gg
</div>
<div id="bg" class="bg" style="display:none;"></div>
<iframe id='popIframe' class='popIframe' frameborder='0' ></iframe>
<a href="javascript:showDiv()">open</a>
<a href="javascript:showDiv()">open</a>
<a href="javascript:showDiv()">open</a>
<a href="javascript:showDiv()">open</a>
<a href="javascript:showDiv()">open</a>
<a href="javascript:showDiv()">open</a>
<a href="javascript:showDiv()">open</a>
<a href="javascript:showDiv()">open</a>
<a href="javascript:showDiv()">open</a>
<a href="javascript:showDiv()">open</a>
<a href="javascript:showDiv()">open</a>
热心网友
时间:2022-04-24 12:23
使用jquery,将提交的表单作为参数传递,然后将其追加到弹出的层中就OK啦