HTML5-Formulare mit jQuery.html5form

Mit dem von Matias Mancini machen Sie aus Ihrem Browser einen HTML5-Kompatiblen Bowser. Mit Einschränkungen aber ...

Mit HTML5 lassen sich schöne, aber vor allem praktikable Formulare bauen. Leider nur, dass viele Browser mit HTML5 noch nicht umgehen können.

Matias Mancini hat sich mit seinem jQuery-Plugin aufgemacht, diesen Missstand ein wenig zu mindern. Mit nur einer Zeile Code im Header stehen Ihnen jetzt Platzhaltern, Maxlength, Autocomplete und den Input-Feldern Url und E-Mail zur Verfügung. Leider werden die Input-Felder Date und Number noch nicht unterstützt.

Aktuell werden folgende Browser unterstützt.
  • Internet Explorer: IE6 - IE7 - IE8 - IE9 beta
  • Mozilla Firefox: 3.0 - 3.5 - 3.6 - 4.0 beta4
  • Google Chrome: 4.0 - 5.0 - 6.0
  • Apple Safari: 4.0 - 5.0

so einfach gehts

Im ersten Schritt werden die notwendigen jQuery und jQuery.html5form im header eingebunden

<head>

    //jQuery library
    <script src='http://code.jquery.com/jquery-1.4.2.min.js'></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>

Dann einfach nur ein HTML5 Formular aufbauen und fertig. Es werden keine Classen benötigt. Die notwendigen Informationen erhält jQuery.html5form über die Attribute.

<input type='email' name='email' id='email'/>

Den Rest übernimmt jetzt jQuery.html5form. In diesem Beispiel wird auf Korrektheit der Emailadresse automatisch geprüft.

Auf die selbe einfache Art und Weise können Required -Elemente erstellt werden.

<input type='text' name='lastname' required />

Unter http://www.matiasmancini.com.ar/html5form_en.php findet Ihr weitere Beispiele

Author

Ratings

There are no comments available yet.

Here you can write a comment


Please enter at least 10 characters.
Loading... Please wait.
* Pflichtangabe

Related topics

How to effectively perform complex queries with SQL queries in MySQLi?

This MySQL tutorial explains how to efficiently perform complex SQL queries in MySQLi. We will look at various aspects of database querying and learn specific methods to fully utilise the power of MySQLi. ...

TheMax

Autor : TheMax
Category: mySQL-Tutorials

Wie schreibt man ein Forum mit PHP und Mysql

Wie schreibt man ein Forum mit PHP und Mysql

Wie erstellt man ein kleines Forum mit PHP und MYSQL? Dieses Tutorials zeigt wie es geht ...

Moqui

Autor : Moqui
Category: PHP-Tutorials

PHP cURL Tutorial: Using cURL to Make HTTP Requests

cURL is a powerful PHP extension that allows you to communicate with different servers using various protocols, including HTTP, HTTPS, FTP, and more. ...

TheMax

Autor : TheMax
Category: PHP-Tutorials

Dateien per Userinterface hochladen

Um Dateien per Userinterface hochladen zu können, benötigt man vergleichbar wenige Kenntnisse in der Programmiersprache PHP ...

Lukas Beck

Autor : Lukas Beck
Category: PHP-Tutorials

Installation von MySQL auf Linux

SuSE Linux Pro 8.2 mit mysql einfach installieren ...

Moqui

Autor : Moqui
Category: Linux & Server Tutorials

Objektorientiertes Programmieren

Dieses Tutorial beschreibt sehr gut die Wirkunsweise von objektorientiertes Programmieren. Also bestens geeignet um das objektorientierte Programmieren zu verstehen. ...

phpsven

Autor : phpsven
Category: PHP-Tutorials

grafischen Counter

Oftmals wird gefragt wie man einen grafischen Counter mit PHP realisieren könnte. Hier ist die Antwort ...

t63@

Autor : t63@
Category: PHP-Tutorials

Login mit Hilfe von PHP und mySQL

Dieses Tutorial soll die Grundzüge eines Login-Systems auf der Basis von PHP und mySQL unter Zuhilfenahme von Sessions klären. ...

razorblade

Autor : razorblade
Category: PHP-Tutorials

Publish a tutorial

Share your knowledge with other developers worldwide

Share your knowledge with other developers worldwide

You are a professional in your field and want to share your knowledge, then sign up now and share it with our PHP community

learn more

Publish a tutorial