我創建了amp表單。 當我點擊Butona時,我從不同的頁面檢查表單中的值。 我在這裏沒有問題。 如果所有的數據都是正確的,我想指示一個獨特的adrese。 如果表單是正面的,我該如何指導訪問者?Amp XHR表格頁重定向
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script>
<form method="POST" action-xhr="//example.com/control" target="_top">
<input type="checkbox" name="items[]" value="1" />
<input type="checkbox" name="items[]" value="2" />
<input type="checkbox" name="items[]" value="3" />
...
<button type="submit" class="btn">Check and go</button>
<div submit-success>
<template type="amp-mustache">
{{message}}
</template>
</div>
<div submit-error>
<template type="amp-mustache">
{{message}}
</template>
</div>
</form>
我在變量message中顯示Json的請求。 我想轉發一個不同的地址,而不是顯示最後一條消息。 AMP可以嗎?
請加您的代碼 –
我添加了代碼。 – PHPSEO