HTML Formulieren

HTML <input> maxlenght attribuut

  • Het maxlenght attribuut specificeert het max. aantal karakters dat kan worden ingevoerd in het <input> element.

Attribuut voorbeeld in XHTML

<html>
<body>
<form action="antwoord_accept.php">

Gebruikersnaam:<input type="text" name="gebruiker" maxlength="8" value="max. 8 karakters">
Paswoord:<input type="password" name="pasw" maxlength="4">
<input type="submit" value="verzend">
</form>
</body>
</html>

Gebruikersnaam:  
Paswoord:  
        
tip

Enkel bij <input type="text"> en <input type="password">

Attribuut waarde

Waarde Beschrijving
cijfer/getal Het maximum aantal karakters dat kan worden ingevoerd.

naar boven 

Opbouw

<input maxlength="cijfer/getal"> in HTML
<input maxlength="cijfer/getal" /> in XHTML

Browser ondersteuning

Internet Explorer Firefox Chrome Opera Safari

  • Het <input> maxlenght attribuut wordt ondersteunt in de bekende browsers.
naar boven naar boven naar name attribuut
naar boven naar het name attribuut