惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - jackyrong的世界

本BLOG迁移到javaeye .net中javascript去调用webservice - jackyrong的世界 - 博客园 asp.net 4中的新特性之一:控制URL长度 vs.net 2010中使用code snippets - jackyrong的世界 asp.net 2010中jquery调用webservice php中存储IP的一个不错的方法 介绍又一个不错的TOMCAT监控好工具probe jquery中输入验证中一个不错的效果 - jackyrong的世界 - 博客园 软件工程心理学系列11之如何应对客户的严厉批评 团队中不能只有梅西呀 mysql 性能学习1 6个PHP漏洞扫描工具 监控JAVA应用的好工具javamelody (转)Math.Round() -- c# 与 java的区别 云估算? apache 的mod-status 如何带平均年龄小的团队 本人售买一本o'relliy 出版社的《WCF服务编程》书,有意的广州朋友当面交易 小结php的字符串用法 - jackyrong的世界 - 博客园
一个模仿HTML5功能的jquery控件 - jackyrong的世界 - 博客园
jackyrong的世界 · 2010-08-30 · via 博客园 - jackyrong的世界

原文:http://www.matiasmancini.com.ar/html5form_en.php

大致将要点翻译下:
  在HTML5中,验证输入框等都可以不用JAVASCRIPT就能实现了,现在只有少部分浏览器
支持这个功能;现在,可以使用jquery插件去模拟这个功能了。安装:
<head>
    
    //jQuery library
    <script src="http://code.jquery.com/jquery-1.4.2.min.js%22%3E%3C/script>
    
    //jQuery.html5form plugin
    <script src="http://html5form.googlecode.com/svn/trunk/jquery.html5form-min.js">
    </script>
   
    <script>
        $(document).ready(function(){
            $('#myform').html5form();   
        });
    </script>

</head>

HTML5的一些特征如下:
1)属性placeholder
  <input type="text" placeholder="Full Name"/>
placeholder的作用是,当你在文本框没输入任何东西,时,
会自动光标停留在文本框中
2)EMAIL
 <input type="email" name="email" id="email"/>
3)TEXTAREA
  <textarea maxlength="60" name="comment" id="comment"/>
4) URL
  <input type="url" name="website" placeholder="http://%22/>
这个表明必须输入的是url
  使用这个控件
<script>
   
    $('#myform').html5form({
       
        async : false, // cancels the default submit method.
        method : 'GET', // changes the request method.
        action : 'respuesta.php', // changes the action method.
        responseDiv : '#respuesta' // a content div to get the callback function response.
       
    })
   
</script>

5 当有多个form时
 <script>

    $('#myform_one').html5form({
        method: 'POST',
    });

    $('#myform_two').html5form({
        method: 'GET'
    });

</script>

支持所有浏览器:
<script>

    $('#myform').html5form({
        allBrowsers: true
    });

</script>

下载见:
http://html5form.googlecode.com/svn/trunk/jquery.html5form-min.js