Skip to content

Add a section about form.submit action and input change events #7275

@mkhatib

Description

@mkhatib

We landed support for input change event and exposing form.submit action that can be used together to support submit-on-change kind of behavior.

We need to update AMP-form docs to add a section about form.submit action and input change event. See the forms.amp.html example for more details on syntax and usage.

<form method="post"
      id="poll1"
      action-xhr="/form/json/poll1"
      target="_blank">
    <fieldset>
        <p>What is your favorite flightless bird?</p>
                <label>
                    <input name="question1" value="Penguins" type="radio" on="change:poll1.submit">
                    Penguins
                </label>
                <label>
                    <input name="question1" value="Ostriches" type="radio" on="change:poll1.submit">
                    Ostriches
                </label>
                <label>
                    <input name="question1" value="Kiwis" type="radio" on="change:poll1.submit">
                    Kiwis
                </label>
                <label>
                    <input name="question1" value="Wekas" type="radio" on="change:poll1.submit">
                    Wekas
                </label>
    </fieldset>
</form>

Reference bug: #4272

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions