简体   繁体   English

如何在我的 Wordpress 网站中实施 Post-grid- 地址检查器 联系我们页面以进行地址验证

[英]How Can Implement Post-grid- Address checker into My Wordpress Website Contact us page For Address Verify

I am Looking for How to Implement "Postgrid" - Address checker into My Wordpress Website Contact us page For Address Verify.我正在寻找如何在我的 Wordpress 网站“联系我们”页面中实施“Postgrid”地址检查器以进行地址验证。 i have simple contact us page on my website,我的网站上有简单的联系我们页面,

Address Checker Website: https://www.postgrid.com/address-checker/地址查询网站: https://www.postgrid.com/address-checker/

` `

联系我们页面表格

Since you're using WordPress the integration should be straightforward if you have access to the HTML of your page.由于您使用的是 WordPress,因此如果您有权访问页面的 HTML,则集成应该很简单。 Here is the link to the guide that goes over the integration.是介绍集成的指南的链接。

First, you need to retrieve your API key from the developers page on the PostGrid dashboard (you'll need to create an account if you haven't made one already).首先,您需要从 PostGrid 仪表板上的开发人员页面检索您的 API 密钥(如果您还没有创建帐户,则需要创建一个帐户)。 If you're hosting this site on a publicly accessible web page, you'll want to create a "Public" key and add the URL of your website to the list of valid origins.如果您在可公开访问的 web 页面上托管此网站,您需要创建一个“公共”密钥并将您网站的 URL 添加到有效来源列表中。 This will ensure nobody can grab your API key and use it on their own website.这将确保没有人可以获取您的 API 密钥并在他们自己的网站上使用它。

Second, you'll need to add special attributes to the tags in your HTML form element for the form.其次,您需要为表单的 HTML 表单元素中的标签添加特殊属性。 You'll want to add a data-pg-verify attribute to your form tag and then data-pg-address-line1 tag to your Physical Address form field.您需要将data-pg-verify属性添加到您的form标签,然后将data-pg-address-line1标签添加到您的 Physical Address 表单字段。 You'll also want to add a data-pg-full-address-line1 attribute to your form tag to ensure that the autocomplete places the complete address into that one form field instead of looking for separate city, province/state, country fields.您还需要将data-pg-full-address-line1属性添加到您的form标签,以确保自动完成功能将完整的地址放入该表单字段中,而不是寻找单独的城市、省/州、国家/地区字段。

Lastly, you can set up elements which will display the errors (if any) with the address (eg data-pg-status , data-pg-generic-message , etc).最后,您可以设置将显示带有地址的错误(如果有的话)的元素(例如data-pg-statusdata-pg-generic-message等)。 The linked guide outlines how to do this in detail.链接的指南详细介绍了如何执行此操作。

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

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