PDA

View Full Version : Question & Answer form



Luzzy
12-17-2006, 01:18 PM
I have been to a website offering free scripts and managed to find a Question & Answer form.
The script works fine except for the 'answer' section which is continually blank. I am able to change the questions but not the answers. Can anyone see the error in the script. Any help appreciated.


<form name="form1"> <table border="0"> <tr>
<td> <script language="JavaScript"> <!-- This script
supplied free by Hypergurl.com http://www.hypergurl.com --> <!-- function
showAnswer(whatForm){ if(document.forms[whatForm].question.value=="none"){
document.forms[whatForm].answer.value="^ Please select a question above ^"
}else{ document.forms[whatForm].answer.value=document.forms[whatForm].question.value
}} // --> </script> <b>Please select a question:</b> </td>
<td valign="top"> <select name="question" size="1"
onChange="showAnswer('form1')"> <option value="none">
</option> <option value="Your answer!">Your question?</option>
<option value="Your answer!">Your question? </option> <option
value="Your answer!">Your question?</option> <option value="Your
answer!">Your question?</option> </select> </td> </tr>
<tr> <td align="right"><b>Here is your answer:</b>
</td> <td> <textarea name="answer" rows="8"
cols="40" readonly></textarea> </td> </tr> </table>
</form>

y1k2h3
12-18-2006, 05:18 AM
<select name="question" size="1" onChange="showAnswer('form1');">
<option value="none"> </option>
<option value="Your answer 1!">Your question? 1</option>
<option value="Your answer 2!">Your question? 2</option>
<option value="Your answer 3!">Your question? 3</option>
<option value="Your answer 4!">Your question? 4</option>
</select>


Hope the above code will give u a better picture