Closed Thread Icon

Topic awaiting preservation: Dynmic form reference or tutorial Pages that link to <a href="https://ozoneasylum.com/backlink?for=8869" title="Pages that link to Topic awaiting preservation: Dynmic form reference or tutorial" rel="nofollow" >Topic awaiting preservation: Dynmic form reference or tutorial\

 
Author Thread
bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 09-25-2003 19:45

Hey all I'm working on a tool for work where I want people to be able to make quizzes.

What I would like to be able to do is ask the user how many questions They want to have, and then for each question specify how many possible answers. Then from this information create the appropriate form on the page (without reloading, with multiple pages this is a snap).

Anyone have a good reference for creating form elements and input fields on the fly?



.:[ Never resist a perfect moment ]:.

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 09-25-2003 21:27

bitdamaged: You can simply turn your administration tool in something with an [ add a question to the quizz ] button + an [ insert a page break ] button and in each question an [ add an answer ] button. And voilà. People will create their quizzes incrementally and you can simply use the DOM to add the form fields on the fly.

Your description suggests you want a simple list of radio buttons with eventually some sort of page breaks. You can make the page break feature with a collection of DIVs with the display property set to 'none' which you toggle to 'block' when needed.

Here's a quick test of simple quizz creation tool.<BLOCKQUOTE><FONT face="Verdana, Arial">code:</font><HR><pre><html>
<head>
<title>create_quizz

Nevel
Bipolar (III) Inmate

From: Amsterdam
Insane since: Jun 2002

posted posted 09-26-2003 12:52

Or you could of course use javascript objects to hold the questions, the answers, and the "right or wrong" value.
After that you could send the number of right answers to a php-form, which can store the answers in a text file or something.
I've remember writing such a script somewhere.. ah.. found it http://www.blind-justice.nl => "games" => "BJ quizz"
Maybe it can be of some use..

Nevel
Bipolar (III) Inmate

From: Amsterdam
Insane since: Jun 2002

posted posted 09-26-2003 17:35

Ok,

Hope it's more readible now: http://www.codewarrior.nl/~bladibla/asylum/quizz.htm
and http://www.codewarrior.nl/~bladibla/asylum/quizz.js

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 10-07-2003 20:14

No big reason to bump but with some of poi's code I did this

Tested on IE 5 and Moz and it works like a champ. Opera appears to work at first but it doesn't actually submit the data from the dynamically created fields.



.:[ Never resist a perfect moment ]:.

« BackwardsOnwards »

Show Forum Drop Down Menu