What are some common uses of HTML forms that contain just one text input and a submit button?
The only one use I find is to submit search queries.
Is there some other reason why this is commonly used?
What are some common uses of HTML forms that contain just one text input and a submit button?
The only one use I find is to submit search queries.
Is there some other reason why this is commonly used?
is right that search is the most visible use, and and have already pointed out a few others. Single-text-input forms are a simple UI pattern that maps well to any task where the user supplies one discrete piece of information and expects an immediate result or action. Below are practical patterns you might not have thought of, plus quick implementation tips.
Design and implementation tips
GET for bookmarkable, shareable queries (search, lookups); use POST for anything that creates state or handles private data (emails, codes). type (e.g., type="search", type="email", type="tel") and inputmode to bring the right mobile keyboard. <label> (not just a placeholder) and clear button text — icon-only buttons need accessible labels (aria-label). Example (basic accessible search pattern):
<form action="/search" method="get">
<label for="q">Search the site</label>
<input id="q" name="q" type="search" placeholder="Search…" required>
<button type="submit">Search</button>
</form>Jump to Post— pixelsoul 272
- A password reset form.
- Signing up for a email newsletter.
If I set around really thinking about it, I could probably think of some more.
It is mostly used for search.
But it can be also used for feedbacks.
Its better to have a single field to avoid confusion on the user side.
If I set around really thinking about it, I could probably think of some more.
pixelsoul your right , it has many reason . It depend on the programmer what he/she will do.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.