amp-bind doesn't work on form submit-success event
Hi, To whom it may concern:
I try to add a feature after form submit which is clear textarea content when submit-success. So I use amp-bind on and add submit-success event on . But looks lke the binding doesn't work when submit-success occured.
Here comes my code:
<form method="post" action-xhr="WS_qna_post_amp.php" target="_top" on="submit-success:AMP.setState({status:{post:random()}})">
<textarea name="q" [text]="status.post"></textarea>
<input type="reset" role="button" tabindex="0" value="cancel" />
<input type="submit" value="submit" />
</form>
Have a nice day.
Paul
@meistudioli I am unable to repro. Please see https://jsbin.com/mevepezoga/edit?html,js,output for a sample that works fine.
It might be that your XHR endpoint doesn't actually return success?
Closing the issue, feel free to reopen if still a problem.
Hi, @aghassemi :
I check your sample and the problem still happen. Please fill both field (input & textarea) and press "Subscribe" button. You will see the textarea's value can't be modify.
Please check my steps. Steps - video
Thanks for concern this issue and have a nice day.
Paul
Interesting! Changing contextContent on TextArea only works if user has not manually inputted anything... Seems consistent across browsers. Reopening.
Dupe of #11246.
Hi, @choumx:
Looks like the issue has been fixed. Do you have any idea about when this fixed will release on prod ?
Have a nice day.
Paul
Should hit prod by middle of next week.
Hi, To whom it may concern:
I want to update the input element value on submit-success of the amp-form using the AMP State which is "isFav" But it just make the input blank,
Here comes my code:
Please help.