2016-03-09 74 views

回答

0

I'm猜测你是在Web查看器显示的形式,想查找数据提取到的FileMaker领域?

首先你不能使用GetLayoutObjectAttribute函数来做到这一点,因为它只会获取网页的源代码。它不会获取当前仅显示最初从http请求中加载的HTML的数据。

然而,您可以添加一个JavaScript回调,当用户从下拉列表中选择一个值时触发。回调使用window.location使用FileMaker URI模式调用FileMaker脚本,并将输入中的数据作为参数发送到filemaker脚本。然后,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> 

你需要使用谷歌的API回调或其他一些其他机制像的onClick一个按钮来触发storeData()函数。

您还需要在FileMaker中添加一个可由URI调用的脚本。无论您命名该脚本,还需要将其插入到URI的部分URI中。您还需要将URI更改为主机IP或域以及创建filemaker脚本的数据库名称。

在您的FileMaker脚本中,值将作为$变量提供,您可以使用“设置字段”脚本步骤将它们设置为字段。

希望这会有帮助

+0

你好卡勒!你有没有尝试过这个解决方案! 2天后,我仍然坚持下去......如果你有一个函数例子,它会很棒!没有你的Api Key当然;-) – AndyFromParis