【发布时间】:2016-06-23 18:05:27
【问题描述】:
我尝试在 Filemaker 14 中使用包含这个 google api Autocomplete for Addresses and Search Terms。
我用这个form。
我希望在正确的 FM 字段中获取源代码的数据。
但是我在源代码中没有找到数据。
有人试过吗?如果是成功;-),你有任何线索吗?
谢谢
【问题讨论】:
标签: google-maps autocomplete filemaker
我尝试在 Filemaker 14 中使用包含这个 google api Autocomplete for Addresses and Search Terms。
我用这个form。
我希望在正确的 FM 字段中获取源代码的数据。
但是我在源代码中没有找到数据。
有人试过吗?如果是成功;-),你有任何线索吗?
谢谢
【问题讨论】:
标签: google-maps autocomplete filemaker
我猜您是在 web 查看器中显示表单并希望将查找数据提取到 FileMaker 中的字段中?
首先,您不能使用 GetLayoutObjectAttribute 函数来执行此操作,因为它只会获取网页的源代码。它不会获取当前显示的数据,而只会获取最初从 http-request 加载的 HTML。
但是,您可以添加一个 JavaScript 回调,当用户从下拉列表中选择一个值时触发该回调。回调使用 window.location 调用使用 FileMaker URI 架构的 FileMaker 脚本,并将来自输入的数据作为参数发送到 filemaker-script。然后,filemaker 脚本将它们存储在数据库中。
类似的东西
<script type="text/javascript">
function storeData() {
// Set up base URI. You need to modify host-ip, database name and script name
var uri = 'FMP://your-host-ip/databasename?script=scriptname';
// Add form fields as parameters to the URI. These will be $variables in your filemaker script
uri = uri + getParameter('street_number');
uri = uri + getParameter('route');
uri = uri + getParameter('locality');
uri = uri + getParameter('administrative_area_level_1');
uri = uri + getParameter('postal_code');
uri = uri + getParameter('country');
// Call the URI to perform FileMaker script
window.location = uri;
}
function getParameter(name)
{
// Return a string that can be used as a URI param
return '&$' + name + '=' + document.getElementById(name).value;
}
</script>
您需要使用 google-api 回调或其他一些机制(例如带有 onClick 的按钮)来触发 storeData() 函数。
您还需要在 FileMaker 中添加一个可由 URI 调用的脚本。无论您如何命名该脚本,您还需要将其插入到 URI 的 scriptname-part 中。您还需要将 URI 更改为您的主机 IP 或域以及创建 filemaker-script 的数据库名称。
在您的 FileMaker 脚本中,这些值将作为 $variables 提供,您可以使用“设置字段”脚本步骤将它们设置为字段。
希望对你有帮助
【讨论】: