预览表单,查看后确认提交或者返回重填
XML/HTML Code
JavaScript Code
<script> <BR>$(document).ready(function() { <BR> $('#myform').previewForm(); <BR>}); <BR></script>
previewForm.js
(function($){
$.fn.previewForm = function(options){
var form_settings = $.extend({
identifier : 'label',
show_password : true,
extratext : 'Do You Want To submit',
yes : 'yes',
no : 'no',
title : 'Please preview'
}, options);
var dia_log;
var renderBUTTON;
var this_frm;
this_frm = $(this);
$(this).submit(function (){
if($('#pfomdata').length){
return true;
}
dia_log="";
var needle_cnfrm;
if(this.id.length > 0){ needle_cnfrm = '#'+this.id+' label'; }
else { needle_cnfrm = '.'+$(this).attr('class')+' label'; }
$(needle_cnfrm).each(function(i,val) {
if($(this).text().length >2){
what_t= $('#'+$(this).attr('for')) ;
switch(what_t.prop('type')){
case 'password':
if(!form_settings.show_password)
dia_log +=$(this).text() + " your selected password
";
else
dia_log +=$(this).text() +what_t.val()+"
";
break;
case 'select-one':
dia_log +=$(this).text() +$('#'+$(this).attr('for')+' option:selected').text()+"
";
break;
case 'radio':
if( what_t.is(':checked'))
dia_log +=$(this).text() +' '+what_t.val()+"
";
break;
case 'checkbox':
if( what_t.is(':checked'))
dia_log +=$(this).text() +' '+what_t.val()+"
";
break;
case 'undefined':
break;
default:
dia_log +=$(this).text() +what_t.val()+"
";
break;
}
}
});
dia_log = dia_log.replace('undefined', '');
renderBUTTON="";
renderBUTTON += ''+form_settings.yes+'';
renderBUTTON += ''+form_settings.no+'';
var renderTemplate = [
'
'
'
',form_settings.title,'
','
',dia_log,'
','
',form_settings.extratext,'
','
renderBUTTON,
'
].join('');
$(renderTemplate).hide().appendTo('body').fadeIn();
$(".form_yes") .click(function(){
var input = $("").attr("type", "hidden").attr("id", "pfomdata").val("true");
this_frm.append($(input));
this_frm.submit();
});
$(".form_no") .click(function(){
$('#previewOverlay').fadeOut(function(){
$(this).remove();
});
});
return false;
});
}
})(jQuery);
previewForm.css
#previewOverlay{
width:100%;
height:100%;
position:fixed;
top:0;
left:0;
background:url('ie.png');
background: -moz-linear-gradient(rgba(11,11,11,0.1), rgba(11,11,11,0.6)) repeat-x rgba(11,11,11,0.2);
background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(11,11,11,0.1)), to(rgba(11,11,11,0.6))) repeat-x rgba(11,11,11,0.2);
z-index:100000;
}
#previewBox{
background:url('body_bg.jpg') repeat-x left bottom #e5e5e5;
width:460px;
position:fixed;
left:50%;
top:50%;
margin:-130px 0 0 -230px;
border: 1px solid rgba(33, 33, 33, 0.6);
-moz-box-shadow: 0 0 2px rgba(255, 255, 255, 0.6) inset;
-webkit-box-shadow: 0 0 2px rgba(255, 255, 255, 0.6) inset;
box-shadow: 0 0 2px rgba(255, 255, 255, 0.6) inset;
}
#previewBox h1,
#previewBox p{
font:26px/1 'Cuprum','Lucida Sans Unicode', 'Lucida Grande', sans-serif;
background:url('header_bg.jpg') repeat-x left bottom #f5f5f5;
padding: 18px 25px;
text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);
color:#666;
}
#previewBox h1{
letter-spacing:0.3px;
color:#888;
}
#previewBox p{
background:none;
font-size:16px;
line-height:1.4;
padding-top: 7px;
}
#previewButtons{
padding:15px 0 25px;
text-align:center;
}
#previewBox .button{
display:inline-block;
background:url('buttons.png') no-repeat;
color:white;
position:relative;
height: 33px;
font:17px/33px 'Cuprum','Lucida Sans Unicode', 'Lucida Grande', sans-serif;
margin-right: 15px;
padding: 0 35px 0 40px;
text-decoration:none;
border:none;
}
#previewBox .button:last-child{ margin-right:0;}
#previewBox .button span{
position:absolute;
top:0;
right:-5px;
background:url('buttons.png') no-repeat;
width:5px;
height:33px
}
#previewBox .form_yes{ background-position:left top;text-shadow:1px 1px 0 #5889a2;}
#previewBox .form_yes span{ background-position:-195px 0;}
#previewBox .form_yes:hover{ background-position:left bottom;}
#previewBox .form_yes:hover span{ background-position:-195px bottom;}
#previewBox .form_no{ background-position:-200px top;text-shadow:1px 1px 0 #707070;}
#previewBox .form_no span{ background-position:-395px 0;}
#previewBox .form_no:hover{ background-position:-200px bottom;}
#previewBox .form_no:hover span{ background-position:-395px bottom;}

C 和JavaScript通过WebAssembly实现互操作性。1)C 代码编译成WebAssembly模块,引入到JavaScript环境中,增强计算能力。2)在游戏开发中,C 处理物理引擎和图形渲染,JavaScript负责游戏逻辑和用户界面。

JavaScript在网站、移动应用、桌面应用和服务器端编程中均有广泛应用。1)在网站开发中,JavaScript与HTML、CSS一起操作DOM,实现动态效果,并支持如jQuery、React等框架。2)通过ReactNative和Ionic,JavaScript用于开发跨平台移动应用。3)Electron框架使JavaScript能构建桌面应用。4)Node.js让JavaScript在服务器端运行,支持高并发请求。

Python更适合数据科学和自动化,JavaScript更适合前端和全栈开发。1.Python在数据科学和机器学习中表现出色,使用NumPy、Pandas等库进行数据处理和建模。2.Python在自动化和脚本编写方面简洁高效。3.JavaScript在前端开发中不可或缺,用于构建动态网页和单页面应用。4.JavaScript通过Node.js在后端开发中发挥作用,支持全栈开发。

C和C 在JavaScript引擎中扮演了至关重要的角色,主要用于实现解释器和JIT编译器。 1)C 用于解析JavaScript源码并生成抽象语法树。 2)C 负责生成和执行字节码。 3)C 实现JIT编译器,在运行时优化和编译热点代码,显着提高JavaScript的执行效率。

JavaScript在现实世界中的应用包括前端和后端开发。1)通过构建TODO列表应用展示前端应用,涉及DOM操作和事件处理。2)通过Node.js和Express构建RESTfulAPI展示后端应用。

JavaScript在Web开发中的主要用途包括客户端交互、表单验证和异步通信。1)通过DOM操作实现动态内容更新和用户交互;2)在用户提交数据前进行客户端验证,提高用户体验;3)通过AJAX技术实现与服务器的无刷新通信。

理解JavaScript引擎内部工作原理对开发者重要,因为它能帮助编写更高效的代码并理解性能瓶颈和优化策略。1)引擎的工作流程包括解析、编译和执行三个阶段;2)执行过程中,引擎会进行动态优化,如内联缓存和隐藏类;3)最佳实践包括避免全局变量、优化循环、使用const和let,以及避免过度使用闭包。

Python更适合初学者,学习曲线平缓,语法简洁;JavaScript适合前端开发,学习曲线较陡,语法灵活。1.Python语法直观,适用于数据科学和后端开发。2.JavaScript灵活,广泛用于前端和服务器端编程。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

mPDF
mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

WebStorm Mac版
好用的JavaScript开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

SublimeText3 Linux新版
SublimeText3 Linux最新版