使用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鈎子。

关注微信公众号

注意!

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



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