amphtml: Unable to setState on chained submit-success
unable to set states on submit-success event of form getting Trust level error as low can we have it as High?
this happens when we are trying to submit another form on the submit-success event of a form
example:
<form action="apicall1" on="submit-success: AMP.setState({dummyName:"Asda"})" id="f1">
<!-- fields -->
</form>
<form action="apicall2" on="submit-success: f1.submit" id="f2">
<!-- fields -->
</form>
on the submit-success
of form f1 it is not able to set the state because it shows it has low trust level to set the state
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16
I will try to explain in layman terms Our page consists two form section
This Form 1 submit action failed and we get following error in console - “submit-success” event with “low” trust is not allowed to invoke “amp.setState”.
above we try to frame a pseudo code for this instance also. I hope we were able to explain from our side this scenario. In case you need more info then let us know.
Why not do OTP verification on the backend at the same time as the username/mobile number submission? This would avoid two roundtrips on client which is definitely slower.