Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Improve forms with HTML5 input types #192

Closed
DangitRick opened this issue Aug 29, 2023 · 1 comment
Closed

Improve forms with HTML5 input types #192

DangitRick opened this issue Aug 29, 2023 · 1 comment
Labels
status: in-progress When an issue or PR is being worked on now. type: feature request New feature or request

Comments

@DangitRick
Copy link
Contributor

Context

HTML5 has been available to use for what feels like ages now, and one really great feature they introduced was an increased number of form input types, such as email, url, number, and so on.

These input types allow mobile browsers to display appropriate keyboards (such as a numpad in the case of "number"), while also often providing instant client-side validation, preventing erroneous form submissions.

Swapping to HTML5 form types will provide users with a more pleasant data entry experience (especially on mobile browsers), while also providing users with instant feedback if they input something in an improper format, without them having to wait for a page reload to get feedback.

Possible implemantion

There are a great many forms throughout WordPress, showing up across both the front and backend. Updating the code would be easy enough — do a codebase search for something like type= and verify that each input is an appropriate type, update it if not, and then verify that the form displays and functions correctly. In the event that that a browser doesn't support one of the newer input types, they should interpret it as a text field, allowing the form to be submitted as it always has been.

Possible Solution

No response

Will you be able to help with the implementation?

Assuming we're okay with deviating from the WordPress codebase in tiny amounts in potentially dozens of places, I'd be willing to go through my test install and see about updating the forms.

This is a big request (a codebase search for type="text" turns up 102 results, with another 6 for type='text'), though obviously not all of them would need changes.

Thoughts?

I know there are some form inputs that will take extra care to replace — such as the time and date fields when editing posts' published time. Changing them to number fields makes them wider and affects the layout of the page.

@DangitRick DangitRick added status: needs triage This issue needs revision, splitting, or other gardening work type: feature request New feature or request labels Aug 29, 2023
@mattyrob mattyrob added status: in-progress When an issue or PR is being worked on now. and removed status: needs triage This issue needs revision, splitting, or other gardening work labels Oct 8, 2023
@mattyrob
Copy link
Collaborator

mattyrob commented Oct 12, 2023

Closed by #200

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: in-progress When an issue or PR is being worked on now. type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants