-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Update amp-form docs and add an expanded note on CORS security. #4485
Conversation
adding @dvoytenko to this since he has done a few of the CORS documentation |
3b5efc6
to
183d601
Compare
__optional__ | ||
You can also provide an action-xhr attribute, if provided, the form will be submitted in an XHR fashion. | ||
|
||
This attribute can be the same or a different endpoint that action and has the same action requirement above. |
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.
"than action" and let's make it action
.
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.
Also, "requirements" (plural)
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.
done
LGTM |
LGTM with few comments |
|
||
## Events | ||
`amp-form` exposes 3 events: | ||
**submit** |
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.
Can you add a line before this line. The "submit" line is showing up at the end of the above line with the colon.
Might also want to consider making these three a bulleted list.
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.
Done
@@ -75,7 +75,108 @@ __required__ | |||
|
|||
Action must be provided, `https` and is non-cdn link (does **NOT** link to https://cdn.ampproject.org). | |||
|
|||
**action-xhr** | |||
__optional__ |
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.
add parentheses on optional
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.
Done.
All other [form attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form) are optional. | ||
|
||
## Inputs | ||
Currently, `<input type=button>`, `<input type=file>`, `<input type=image>` and `<input type=password>` are not allowed. (This might be reconsidered in the future - please let us know if you require these and use cases). | ||
|
||
## Events | ||
`amp-form` exposes 3 events: |
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.
this is formatted wrong, theres no new line before submit
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.
Updated in subsequent pushes.
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.
Done
ITI: #3343