P
Phper
This is the HTML code:
1.Question Title:
<div id="question">
<input type="text" name="question1" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option11" size="6"/>
B.
<input type="text" name="option12" size="6"/>
C.
<input type="text" name="option13" size="6"/>
D.
<input type="text" name="option14" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
2.Question Title:
<input type="text" name="question2" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option21" size="6"/>
B.
<input type="text" name="option22" size="6"/>
C.
<input type="text" name="option23" size="6"/>
D.
<input type="text" name="option24" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
3.Question Title:
<input type="text" name="question3" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option31" size="6"/>
B.
<input type="text" name="option32" size="6"/>
C.
<input type="text" name="option33" size="6"/>
D.
<input type="text" name="option34" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
4.Question Title:
<input type="text" name="question4" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option41" size="6"/>
B.
<input type="text" name="option42" size="6"/>
C.
<input type="text" name="option43" size="6"/>
D.
<input type="text" name="option44" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
5.Question Title:
<input type="text" name="question5" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option51" size="6"/>
B.
<input type="text" name="option52" size="6"/>
C.
<input type="text" name="option53" size="6"/>
D.
<input type="text" name="option54" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
<input type="button" value="Add another question"
onclick="generateQuestion()"/>
<br/>
When the button of "Add another question" is clicked, this snippet of
code will be needed:
6.Question Title:
<input type="text" name="question6" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option61" size="6"/>
B.
<input type="text" name="option62" size="6"/>
C.
<input type="text" name="option63" size="6"/>
D.
<input type="text" name="option64" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
If the button of "Add another question" is clicked again, this snippet
of code is needed:
7.Question Title:
<input type="text" name="question7" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option71" size="6"/>
B.
<input type="text" name="option72" size="6"/>
C.
<input type="text" name="option73" size="6"/>
D.
<input type="text" name="option74" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
This product is about surveys. My website needs to provide a surveyor
a means to create a questionnaire. Since I can't predict how many
questions will be included in a questionnaire, I provide a means with
which a surveyor can make necessary questions at will.
How to do it in Javascript?
1.Question Title:
<div id="question">
<input type="text" name="question1" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option11" size="6"/>
B.
<input type="text" name="option12" size="6"/>
C.
<input type="text" name="option13" size="6"/>
D.
<input type="text" name="option14" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
2.Question Title:
<input type="text" name="question2" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option21" size="6"/>
B.
<input type="text" name="option22" size="6"/>
C.
<input type="text" name="option23" size="6"/>
D.
<input type="text" name="option24" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
3.Question Title:
<input type="text" name="question3" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option31" size="6"/>
B.
<input type="text" name="option32" size="6"/>
C.
<input type="text" name="option33" size="6"/>
D.
<input type="text" name="option34" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
4.Question Title:
<input type="text" name="question4" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option41" size="6"/>
B.
<input type="text" name="option42" size="6"/>
C.
<input type="text" name="option43" size="6"/>
D.
<input type="text" name="option44" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
5.Question Title:
<input type="text" name="question5" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option51" size="6"/>
B.
<input type="text" name="option52" size="6"/>
C.
<input type="text" name="option53" size="6"/>
D.
<input type="text" name="option54" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
<input type="button" value="Add another question"
onclick="generateQuestion()"/>
<br/>
When the button of "Add another question" is clicked, this snippet of
code will be needed:
6.Question Title:
<input type="text" name="question6" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option61" size="6"/>
B.
<input type="text" name="option62" size="6"/>
C.
<input type="text" name="option63" size="6"/>
D.
<input type="text" name="option64" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
If the button of "Add another question" is clicked again, this snippet
of code is needed:
7.Question Title:
<input type="text" name="question7" size="55"/>
<br/>
<br/>
A.
<input type="text" name="option71" size="6"/>
B.
<input type="text" name="option72" size="6"/>
C.
<input type="text" name="option73" size="6"/>
D.
<input type="text" name="option74" size="6"/>
<input type="button" name="Submit" value="Add another
option" />
<br/>
<br/>
This product is about surveys. My website needs to provide a surveyor
a means to create a questionnaire. Since I can't predict how many
questions will be included in a questionnaire, I provide a means with
which a surveyor can make necessary questions at will.
How to do it in Javascript?