如何过滤 SocialEngine 注册表单中的下拉数据?

发布于 2024-10-08 21:21:10 字数 284 浏览 0 评论 0原文

我正在使用基于 Zend Framework 和 Smarty Template 的 Social Engine。

我使用 SocailEngine 管理面板在注册表单中创建了两个自定义下拉字段“国家/地区”和“城市”。 我想知道,有什么方法可以根据所选国家/地区过滤城市下拉列表中的数据吗?

我知道如何使用简单的 AJAX 和 PHP 来实现此功能,但我想知道如何使用 SocialEngine 管理面板来实现此功能,以及在基于 ScocialEngine 的应用程序中实现此功能的最佳方法是什么。

谢谢

I am working with Social Engine which is based on Zend Framework and Smarty Templates.

I have created two custom drop down fields "Country" and "City" in sign up form using SocailEngine admin panel.
I want to know, is there any way to filter the data in City dropdown based on selected Country?

I know how to implement this feature using simple AJAX and PHP, but I want to know how to do this using SocialEngine admin panel and what is the best way to do this in a ScocialEngine based application.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

记忆之渊 2024-10-15 21:21:10

我已经找到了执行此操作的方法,详细信息如下:

  1. 在管理面板中,单击“全局设置”部分中的“个人资料字段”。
  2. 在字段树中添加新字段国家/地区。
  3. 有一个“字段类型”,将其从文本字段更改为下拉选择框。
  4. 向下滚动到选项部分,单击“添加新选项”链接。
  5. 在标签字段中添加国家/地区名称。在依赖项框中,选择“是”并在“依赖项字段标签”框中键入“城市”。
  6. 对于您要在注册表单中添加的所有国家/地区,请重复步骤 5。
  7. 单击“编辑字段”按钮保存更改。
  8. 在字段树中,您将在“国家/地区”字段下看到一个子树。所有国家/地区都将在此树中通过相关字段链接可见。
  9. 单击某个国家/地区的“从属字段”链接,将其设置为下拉菜单,然后用该特定国家/地区的城市填充它。
  10. 对所有国家/地区重复步骤 9。

这需要时间,但这是一次性的努力,您无需修改​​代码即可获得所需的内容。

I have found the way to do this, here are the details:

  1. In admin panel, click 'Profile Fields' in Global Settings sections.
  2. Add a new field Country in fields tree.
  3. There is a "Field Type", change it from Text Field to Pull down Select Box.
  4. Scroll down to Options section, click 'Add New Option' link.
  5. Add country name in Label field. In dependency box, choose Yes and type 'City' in Dependent Field Label box.
  6. Repeat step 5 for all countries you want to add in your signup form.
  7. Click Edit Field button to save changes.
  8. In fields tree, you will see a sub tree under Country field. All countries will be visible in this tree with Dependent Field link.
  9. Click Dependent Field link against a country and make it a drop down and populate it with cities in that specific country.
  10. Repeat Step 9 for all countries.

It will take time but it is a one time effort and you will get what you need without modifying the code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文