{"id":220,"date":"2022-10-27T08:00:00","date_gmt":"2022-10-27T06:00:00","guid":{"rendered":"https:\/\/www.fuhselab.de\/?p=220"},"modified":"2023-08-30T10:37:21","modified_gmt":"2023-08-30T08:37:21","slug":"html-formulare-5","status":"publish","type":"post","link":"https:\/\/www.fuhselab.de\/index.php\/2022\/10\/27\/html-formulare-5\/","title":{"rendered":"HTML Formulare 5"},"content":{"rendered":"\n<p>Noch mehr HTML Formularelemente gibt es im f\u00fcnften Artikel\u2026.Hier kommen jetzt die spannenden HTML 5 Elemente zum Einsatz\u2026<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>Textvorbelegung mit Placeholder:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form action=\u201cDateipfad\u201c method=\u201cpost\u201c accept-charset=\u201cZeichencodierung\u201c>\n&lt;input type=\u201ctext\u201c name=\u201cvorname\u201c placeholder=\u201cMax Mustermann\u201c > Textvorbelegung\n&lt;\/form><\/code><\/pre>\n\n\n\n<p><strong>Pflichtfeld mit Required:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form action=\u201cDateipfad\u201c method=\u201cpost\u201c accept-charset=\u201cZeichencodierung\u201c>\n&lt;input type=\u201ctext\u201c name=\u201cname\u201c required > Pflichtfeld mit required\n&lt;br \/>&lt;br \/>\n&lt;input type=\u201csubmit\u201c value=\u201cAbsenden \u201e>\n&lt;input type=\u201creset\u201c value=\u201cAbbrechen\u201c>\n&lt;\/form><\/code><\/pre>\n\n\n\n<p>Das neue \u201erequired\u201c Attribut ist schon der Knaller, wenn versucht wird das Formular leer abzuschicken, dann gibt es eine Warnung<\/p>\n\n\n\n<p><strong>Autofocus:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form action=\u201cDateipfad\u201c method=\u201cpost\u201c accept-charset=\u201cZeichencodierung\u201c>\n&lt;input type=\u201ctext\u201c name=\u201cvorname\u201c required autofocus > Vorname Pflichtfeld mit required und autofocus\n&lt;input type=\u201ctext\u201c name=\u201cnachname\u201c required > Nachname Pflichtfeld mit required\n&lt;input type=\u201ctext\u201c name=\u201cort\u201c required > Ort Pflichtfeld mit required\n&lt;br \/>&lt;br \/>\n&lt;input type=\u201csubmit\u201c value=\u201cAbsenden \u201e>\n&lt;input type=\u201creset\u201c value=\u201cAbbrechen\u201c>\n&lt;\/form><\/code><\/pre>\n\n\n\n<p>Per \u201eautofocus\u201c wird der Cursor im entsprechenden Formularfeld positioniert.<\/p>\n\n\n\n<p><strong>Formularfeld f\u00fcr E-Mail:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form action=\u201cDateipfad\u201c method=\u201cpost\u201c accept-charset=\u201cZeichencodierung\u201c>\n&lt;input type=\u201cemail\u201c name=\u201cvorname\u201c size=\u201c40\u2033 maxlength=\u201c40\u2033 placeholder=\u201cE-Mail Adresse eintragen\u201c > E-Mail Formularelement\n&lt;br \/>&lt;br \/>\n&lt;input type=\u201csubmit\u201c value=\u201cAbsenden \u201e>\n&lt;input type=\u201creset\u201c value=\u201cAbbrechen\u201c>\n&lt;\/form><\/code><\/pre>\n\n\n\n<p>F\u00fcr E-Mail Adressen gibt es ab HTML5 auch ein eigenes input-Element.<\/p>\n\n\n\n<p>Dieses neue Formularelement wird in PHP noch eine Rolle spielen, denn hier wird schon auf HTML Ebene ein Formularcheck durchgef\u00fchrt, ob eine g\u00fcltige Mailadresse eingegeben wurde.<\/p>\n\n\n\n<p><strong>Formularfeld f\u00fcr Webadresse:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form action=\u201cDateipfad\u201c method=\u201cpost\u201c accept-charset=\u201cZeichencodierung\u201c>\n&lt;input type=\u201curl\u201c name=\u201cvorname\u201c size=\u201c40\u2033 maxlength=\u201c40\u2033 placeholder=\u201cWebadresse eintragen\u201c > Webadresse Formularelement\n&lt;br \/>&lt;br \/>\n&lt;input type=\u201csubmit\u201c value=\u201cAbsenden \u201e>\n&lt;input type=\u201creset\u201c value=\u201cAbbrechen\u201c>\n&lt;\/form><\/code><\/pre>\n\n\n\n<p>Auch das Webadresse-Feld pr\u00fcft schon die Eingabe<\/p>\n\n\n\n<p><strong>Formularfeld f\u00fcr Telefonnummer:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form action=\u201cDateipfad\u201c method=\u201cpost\u201c accept-charset=\u201cZeichencodierung\u201c>\n&lt;input type=\u201ctel\u201c name=\u201cvorname\u201c size=\u201c40\u2033 maxlength=\u201c40\u2033 placeholder=\u201cTelefonnr. eintragen\u201c > Telefonnummer Formularelement\n&lt;br \/>&lt;br \/>\n&lt;input type=\u201csubmit\u201c value=\u201cAbsenden \u201e>\n&lt;input type=\u201creset\u201c value=\u201cAbbrechen\u201c>\n&lt;\/form><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Noch mehr HTML Formularelemente gibt es im f\u00fcnften Artikel\u2026.Hier kommen jetzt die spannenden HTML 5 Elemente zum Einsatz\u2026<\/p>\n","protected":false},"author":1,"featured_media":53,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[23],"class_list":["post-220","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-webdesign","tag-webdesign-gruppe-peine"],"_links":{"self":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/comments?post=220"}],"version-history":[{"count":3,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/220\/revisions"}],"predecessor-version":[{"id":324,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/220\/revisions\/324"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/media\/53"}],"wp:attachment":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/media?parent=220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/categories?post=220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/tags?post=220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}