amp-form custom verification not run when bound input values change

Viewed 37

I am using amp-bind to update amp-form input values that I want to be verified.

My actual use case is an autocomplete address form which fills in the address fields and the postcode should be verified.

When the value is updated, verification is not triggered unless I click inside the input, modify the value, and then click outside the input.

See this code pen which updates a bound form input and does not trigger verification. I use chrome dev tools to see when the verify url is requested.

https://codepen.io/vercer/pen/WNRjVBG

    <form method="post"
        action-xhr="/my-submit-url"
        verify-xhr="/my-verify-url"
        target="_top"
        custom-validation-reporting="interact-and-submit">
      <input type="text" name="the_text" [value]="boundvalue" />
    </form>
    <button on="tap:AMP.setState({boundvalue: 'this value was bound'})">Fill text box</button>

Is there some way to trigger verification? I am using this on a non-amped page so I could even resort to using custom JavaScript to call some method to trigger verification.

Thanks!

0 Answers
Related