简体   繁体   English

Braintree-javascript-如何使需要插入式ui表单完成?

[英]Braintree-javascript - how to make drop-in ui form completion required?

I want to be able to have behavior that is identical to the required attribute for Braintree's drop-in ui such that if the user has not completed Braintree's drop-in ui form, then upon hitting submit the user will receive a notification and cannot progress. 我希望能够具有与Braintree的插入式ui的必需属性相同的行为,这样,如果用户尚未完成Braintree的插入式ui表单,则在单击“提交”时,用户将收到通知且无法继续。

I'm creating a form that looks something like this: 我正在创建一个看起来像这样的表单:

<form>
      <input type ='text' name='fullname' required>
      <!-- braintree drop-in ui form-->
      <div class="text-center" id="payment-form"></div>
      <input type ='text' name='email' required>
</form>

After further testing, I found out that Braintree drop-in ui already has this functionality. 经过进一步测试,我发现Braintree插入式ui已经具有此功能。 It's just that if the bottom most field is unfilled then a notification bubble will appear over that field (in this case if you leave email blank). 只是,如果最底部的字段未填写,则通知气泡将出现在该字段上方(在这种情况下,如果您将电子邮件保留为空白)。 However if you fill out both email and fullname, then the drop-in ui lines will shake and turn red. 但是,如果您同时填写了电子邮件和全名,则ui插入行将摇晃并变成红色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM