-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add JavaScript to code snippet #2536
Conversation
It looks like this is your first pull request. 🎉 Thank you for your contribution! One of the project maintainers will triage and assign the pull request for review. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The EmbedInteractiveExample
macro works in the /mdn/content/ directory.
This directory contains the examples that are embedded using the EmbedInteractiveExample
within MDN. In other words, this repo contains HTML, CSS, and JS, which is can then be pulled into MDN pages using the macro.
To solve the issue raised, you would want to update the code to include a <form>
. The form with no action
will submit to itself, reloading the example in place.
Ok @estelle, I added the form element. |
This part needs to be addressed.
while a label works anywhere in the page, visually the label with the form control it's labelling is vital. Best practices is to put the label next to the input, before the input in most cases, but after a checkbox or radio button. In other words, the label should be in the form. so, the EmbedInteractiveExample needs to be removed, the label needs to be moved to be in the form, and no js was added, but not sure if it needs any |
Hi @estelle! :) I made the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🎉
This pull request has merge conflicts that must be resolved before it can be merged. |
1 similar comment
This pull request has merge conflicts that must be resolved before it can be merged. |
Congratulations on your first merged pull request. 🎉 Thank you for your contribution! Did you know we have a project board with high-impact contribution opportunities? We look forward to your next contribution. |
Description
This PR adds JavaScript to the code snippet in the HTML input example.
Motivation
David Cook mentioned that the demo doesn't demonstrate the browser validation for required or pattern, because it is not inside a
<form>
. By adding JavaScript to it, the example will work.Additional details
Example where the issue takes place
Related issues and pull requests
Fixes #2535