DKDiveDude
IS-IT--Management
OK I'm new to forms in JavaScript.
I'm trying just to get a very simple form and process some data to work with the following code:
1 <HTML>
2 <HEAD>
3 <TITLE>Form Test</TITLE>
4 <SCRIPT>
5 function DisplayChoice() {
6 document.write("Here is the color you selected:"
;
7 document.write(ColorForm.ColorChoice.value);
8 document.write(" - Excellent choice!"
;
9 }
10 </SCRIPT>
11 </HEAD>
12 <BODY>
13 <form name="ColorForm"><select name="ColorChoice">
14 <option value="Red" selected>Red
15 <option value="Green">Green
16 <option value="Blue">Blue
17 </select><br><br>
18 <input name="ShowColor" type="button" id="ShowColor" onClick="DisplayChoice()" value="Show Color"></form>
19 <br>
20 </BODY>
21 </HTML>
Well this works fine in the Opera browser, but it only works in IE if I take out line 6.
I appreciate if somebody could tell me what is wrong.
Thanks
I'm trying just to get a very simple form and process some data to work with the following code:
1 <HTML>
2 <HEAD>
3 <TITLE>Form Test</TITLE>
4 <SCRIPT>
5 function DisplayChoice() {
6 document.write("Here is the color you selected:"
7 document.write(ColorForm.ColorChoice.value);
8 document.write(" - Excellent choice!"
9 }
10 </SCRIPT>
11 </HEAD>
12 <BODY>
13 <form name="ColorForm"><select name="ColorChoice">
14 <option value="Red" selected>Red
15 <option value="Green">Green
16 <option value="Blue">Blue
17 </select><br><br>
18 <input name="ShowColor" type="button" id="ShowColor" onClick="DisplayChoice()" value="Show Color"></form>
19 <br>
20 </BODY>
21 </HTML>
Well this works fine in the Opera browser, but it only works in IE if I take out line 6.
I appreciate if somebody could tell me what is wrong.
Thanks