A jquery control that imitates the HTML5 Function

Source: Internet
Author: User

 

Original article: http://www.matiasmancini.com.ar/html5form_en.php

Below is a rough translation of key points:
In HTML5, verification input boxes can be implemented without JAVASCRIPT. Currently, only a few browsers are available.
This function is supported. Now, you can use the jquery plug-in to simulate this function. Installation:
<Head>

// JQuery library
<Script src = "http://code.jquery.com/jquery-1.4.2.min.js%22%3E%3C/script>

// JQuery.html 5 form plugin
<Script src = "http://html5form.googlecode.com/svn/trunk/jquery.html5form-min.js">
</Script>

<Script>
$ (Document). ready (function (){
Certificate ('{myform'}.html 5 form ();
});
</Script>

</Head>

HTML5 has the following features:
1) attribute placeholder
<Input type = "text" placeholder = "Full Name"/>
Placeholder is used when you do not enter anything in the text box,
The cursor automatically stays in the text box.
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/>
This indicates that the url must be entered.
Use this control
<Script>

Certificate ('{myform'}.html 5 form ({

Async: false, // cancels the default submit method.
Method: 'get', // changes the request method.
Action: 'recordsta. php', // changes the action method.
ResponseDiv: '# respuesta' // a content div to get the callback function response.

})

</Script>

5. When multiple forms exist
<Script>

Certificate ('{myform_one'}.html 5 form ({
Method: 'post ',
});

Certificate ('{myform_two'}.html 5 form ({
Method: 'get'
});

</Script>

Supports all browsers:
<Script>

Certificate ('{myform'}.html 5 form ({
AllBrowsers: true
});

</Script>

For download, see:
Http://html5form.googlecode.com/svn/trunk/jquery.html5form-min.js

Http://www.cnblogs.com/jackyrong/archive/2010/08/30/1812998.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.