如何使用 jquery 和 stripes 创建下拉表单?
我最近了解了 Stripes 框架,并正在我的一个项目中实现它。我正在尝试创建一个由单选按钮问题组成的动态表单。我已经使用这些函数来编码。
我尝试使用 jQuery 但它似乎给了我错误。
例如,用户选择了这个:
`<stripes:radio name="place" value="a"/>a
<stripes:radio name="place" value="b"/>b
<stripes:radio name="place" value="c"/>c
点击该选项后,会显示下一个问题,与上述类似。 但是,当我实现 function () {$(stripes:radio).show()}
链接到下一个问题时,它没有显示。
我走在正确的轨道上还是有更好的方法来解决这个问题?
如果我不够清楚,我深表歉意。我对此还很陌生,请指导我。谢谢你!
I've recently got to know the Stripes framework and is implementing it in one of my project. I'm trying to create a dynamic form consisting of radio-buttoned questions. I've used the functions to code.
I've tried to use jQuery but it seems to give me errors.
For example, the user selected this:
`<stripes:radio name="place" value="a"/>a
<stripes:radio name="place" value="b"/>b
<stripes:radio name="place" value="c"/>c
After clicking on the option, it will show the next question, similar to the abovementioned.
However, when I implement function () {$(stripes:radio).show()}
to link to the next question, it doesn't show.
Am I going on the right track or is there any better ways to solve this?
I apologize if I'm not clear enough. I'm still new to this and please guide me along. thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
'show()' 方法仅在 JQuery 对象上可用,因此您应该使用 JQuery 选择器获取这样的对象(与 Stripes 无关,因为 Stripes 是服务器端,而 JQuery 在浏览器中运行!)。例如:
这将使该 HTML 块可见:
The 'show()' method is only available on a JQuery object, thus you should use a JQuery selector to get such an object (has nothing to do with Stripes, as Stripes is server side and JQuery runs in the browser!). For example:
This will make this block of HTML visible: