Form Controls: input types select textarea
Use text, email, number, date, checkbox, radio, range, file, and color inputs alongside select and textarea elements.
Form Controls: input types select textarea is a free Frontend Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Frontend Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Full Palette of Input Types
HTML5 introduced many specialised input types beyond text. Each tells the browser what kind of data to expect, enabling native validation, appropriate keyboards on mobile, and platform-native UI controls.
Text, Search, and URL Inputs
type="text" is the plain text fallback. type="search" hints a search-optimised keyboard and often shows a clear button. type="url" validates URL format and shows a URL keyboard on mobile.
<input type="text" placeholder="Full name">
<input type="search" placeholder="Search...">
<input type="url" placeholder="https://example.com">Email and Tel
type="email" validates email format and shows an email-optimised keyboard with @ key. type="tel" shows a telephone numeric keyboard (doesn't validate format since phone formats vary by country).
<input type="email" name="email" autocomplete="email">
<input type="tel" name="phone" autocomplete="tel">Number, Range, and Date Types
type="number" with min/max/step for numeric data. type="range" for sliders. type="date", type="time", type="datetime-local" for temporal data with native pickers.
<input type="number" min="0" max="100" step="5" value="50">
<input type="range" min="0" max="100" value="60">
<input type="date" min="2025-01-01">
<input type="time">Checkbox and Radio
Checkboxes are independent toggles. Radio buttons in the same group (same name) allow only one selection. Each needs a paired label.
<fieldset>
<legend>Notification preferences</legend>
<label><input type="checkbox" name="email_notif" value="1"> Email</label>
<label><input type="checkbox" name="sms_notif" value="1"> SMS</label>
</fieldset>
<fieldset>
<legend>Plan</legend>
<label><input type="radio" name="plan" value="free"> Free</label>
<label><input type="radio" name="plan" value="pro"> Pro</label>
</fieldset>Color, File, and Hidden
type="color" shows a native colour picker. type="file" opens a file dialog; use the accept attribute to restrict file types. type="hidden" submits data without a UI control.
<input type="color" name="theme_color" value="#3182ce">
<input type="file" accept="image/png, image/jpeg">
<input type="hidden" name="csrf_token" value="abc123">Select Dropdowns
The <select> element creates a dropdown. Use multiple for multi-select (rarely good UX). Group options with <optgroup> for long lists.
<select name="country">
<option value="">Select a country...</option>
<optgroup label="Europe">
<option value="de">Germany</option>
<option value="fr">France</option>
</optgroup>
<optgroup label="Americas">
<option value="us">United States</option>
</optgroup>
</select>Textarea
<textarea> creates a multi-line text input. Use rows and cols for initial size or CSS for more control. The closing tag is required and any content between tags is the default value.
<label for="bio">Bio</label>
<textarea id="bio" name="bio" rows="5" maxlength="500"
placeholder="Write something about yourself..."></textarea>Datalist — Autocomplete Options
<datalist> provides a list of suggestions for an input without restricting free text. Link input to datalist with the list and id attributes.
<input type="text" list="languages" name="language" placeholder="Type a language">
<datalist id="languages">
<option value="JavaScript">
<option value="TypeScript">
<option value="Python">
<option value="Rust">
</datalist>The value and name Attributes
name is the key sent in the form submission. value sets the initial value. For checkboxes and radios, value is what gets submitted when checked. For text inputs, value is the pre-filled content.
input Sizing and placeholder
placeholder shows hint text when the input is empty. It disappears on focus and is not a substitute for a visible label. size sets the visible width in characters; prefer CSS for sizing.
Quick Check
Which input type shows a numeric keyboard on mobile and validates that the entered value is a valid number?
Recap: Form Controls
Use semantic input types: email for emails, number for numbers, date for dates. Use select for fixed choices, datalist for suggestive autocomplete, textarea for multi-line text. Always include name attributes for submission and value attributes where appropriate.
Frequently asked questions
Is the “Form Controls: input types select textarea” lesson free?
Yes — the full text of “Form Controls: input types select textarea” is free to read here on the web, and the Frontend Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Frontend Academy course, upgrade to CoddyKit PRO.
What will I learn in “Form Controls: input types select textarea”?
Use text, email, number, date, checkbox, radio, range, file, and color inputs alongside select and textarea elements. You practise Frontend Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Frontend Academy?
No prior experience is required. Frontend Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Form Controls: input types select textarea” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Frontend Academy lesson?
Yes. Every Frontend Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Form Controls: input types select textarea
- ARIA and Accessibility: label role aria-*
- Semantic HTML5: semantic vs div soup
- Form Validation Attributes