使用jQuery创建调查 - 任何示例?

[英]Creating a Survey using jQuery - Any examples?


I'm looking for a very basic survey/wizard example using jQuery and HTML. I'd like it to connect to a text file or XML file and be independent of SQL, PHP, ASP.NET, or any other scripting language outside of JavaScript.

我正在寻找一个使用jQuery和HTML的非常基本的调查/向导示例。我希望它能连接到文本文件或XML文件,并且独立于SQL,PHP,ASP.NET或JavaScript之外的任何其他脚本语言。

TIA

TIA

UPDATE: I'm looking for a solution that will ask a single question at a time. Then, based on the multiple choice option selected, I want to show a result and then allow the user to continue to the next question. Like I said earlier, more of a wizard-like survey solution.

更新:我正在寻找一个可以一次提出一个问题的解决方案。然后,根据选择的多项选项,我想显示一个结果,然后允许用户继续下一个问题。就像我之前说的那样,更像是一个类似巫师的调查解决方案。

UPDATE 2: I'm also not looking to store any results. Let me explain this a different way. On the homepage of a website that offers other services, we want to show a single question with 5 multiple choice answers. The user would have the ability to choose an answer and click submit. Upon clicking submit, the div would refresh with the results based on the answer they selected and ask if they'd like to see another question. There's no storing of data. It's more less a fun exercise to show content.

更新2:我也不打算存储任何结果。让我以不同的方式解释这一点。在提供其他服务的网站的主页上,我们希望显示包含5个多项选择答案的单个问题。用户可以选择答案并单击“提交”。单击提交后,div将根据他们选择的答案刷新结果,并询问他们是否想要查看其他问题。没有存储数据。显示内容更不是一种有趣的练习。

4 个解决方案

#1


2  

http://plugins.jquery.com/project/Survey

http://plugins.jquery.com/project/Survey

Here's an example: http://flesler.webs.com/jQuery.Survey/

这是一个例子:http://flesler.webs.com/jQuery.Survey/

The example loads the details from a JSON object, which in my opinion is much better suited for this task than a text file or XML.

该示例从JSON对象加载详细信息,在我看来,它比文本文件或XML更适合此任务。

#2


4  

I have created an open source JavaScript Survey library under MIT license. It goes with Visual Designer and it is JSON based.

我在MIT许可下创建了一个开源JavaScript调查库。它与Visual Designer一起使用,它基于JSON。

It does not store results by default and of course you may put just one question on the page. You may set-up a logical expression (visibleIf property) for questions/panels/pages to control their visibility, or you may just change a question/panel/page visible property onValueChanged event:

它默认不存储结果,当然您可以在页面上只放一个问题。您可以为问题/面板/页面设置逻辑表达式(visibleIf属性)以控制其可见性,或者您可以只更改问题/面板/页面可见属性onValueChanged事件:

survey.onValueChanged.add(function (sender, options) {
    survey.getQuestionByName(“myquestionName”).visible = myBooleanValue;
});

You may show/store your data on onCurrentPageChanged, onComplete and onValueChanged events.

您可以在onCurrentPageChanged,onComplete和onValueChanged事件上显示/存储您的数据。

There are plenty other options. For example, you may use your own “Prev”, “Next” and “Complete” buttons.

还有很多其他选择。例如,您可以使用自己的“上一个”,“下一个”和“完成”按钮。

#3


2  

a good example of jquery ui and jquery mobile survey generator: http://mobosurvey.com/survey/designer

jquery ui和jquery移动测量发生器的一个很好的例子:http://mobosurvey.com/survey/designer

#4


2  

Apparently jQuery plugin from @Luca's answer is no longer on jQuery site. What I found is this:

显然来自@Luca答案的jQuery插件已不再是jQuery网站上的。我发现的是:

https://github.com/jdarling/jQuery.Survey

https://github.com/jdarling/jQuery.Survey

Maybe it's the same one.

也许它是一样的。

It can show one question per page and has a nextPage hook to override.

它可以在每页显示一个问题并具有要覆盖的nextPage钩子。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2009/02/04/7df00e1f4bf6e4f8d02662689c8109d3.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告