Joomla! 中的自定义选项组件帮助

发布于 2024-08-31 05:16:21 字数 149 浏览 5 评论 0原文

我正在构建一个模块或组件,但还不确定,但我需要一些依赖于另一个选项的选项。例如,如果您选择“A”,则会出现选项 1、2 和 3。如果您选择“B”,则会出现 4,5 和 6。 我可以让所有内容立即显示,只需发送,但我可以让某些参数仅在选择另一个参数后才显示吗?

谢谢。

I am building a module, or component not sure yet, but I need to have a some options that depend on another option. For example, if you choose "A" then options 1, 2 and 3 appear. If you choose "B" then 4,5 and 6 appear.
I can make everything appear at once just sending in the but can I make some params only appear after another is chosen?

Thank you.

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

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

发布评论

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

评论(1

゛清羽墨安 2024-09-07 05:16:21

使用 javascript 可以相当简单地实现这一点(即,它将在用户的 PC 上运行,无需往返服务器)。

将所有控件放在表单上,​​但对于那些您不希望显示的控件,最初使用CSS属性{display:none},它们将不会显示。

然后使用控件的 onclick() 事件,该事件将确定其他控件是否可见,以根据需要显示/隐藏控件。

这里有一个与此类似的示例(不在 Joomla 内,但没有理由(我能想到)为什么这在 Joomla 模块/组件中不能正常工作): http://www.java2s.com/Code/JavaScript/Development/Makebuttoncontrolvisibleorinvisible.htm

This should be reasonably simple to achieve using javascript (i.e. it will run on the user's PC without a round-trip back to the server).

Put all the controls on the form, but for the ones that you do not wish to display initially use the CSS attribute {display:none} and they won't show.

Then use the onclick() event of the control which will determine whether other controls are made visible to show / hide controls as you wish.

There is an example of something similar to this (not within Joomla, but there is no reason (that I can think of) why this won't also work fine within a Joomla module / component) here: http://www.java2s.com/Code/JavaScript/Development/Makebuttoncontrolvisibleorinvisible.htm

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