Forum Moderators: open
Here is the code:
THE PROBLEM IS THAT THE END VALUE READS $MyValue1 instead of the actual string. Any help would really be appreaciated.
<SCRIPT>
//set variable
$MyValue1="TEST Value"
$MyValue2="TEST Value"
document.write("<form name='test'>");
document.write("<select size=1 name=options onchange=test.text1.value=test.options.value>");
document.write(" <option>Choose one...</option>");
document.write("<option value=$MyValue1>option1</option>");
document.write("<option value=$MyValue2>option2</option>");
document.write("</select>");
document.write("<input type=text name=text1>");
document.write("</form>");
</SCRIPT>
Kind Regards
Walker
In javascript it should look liek this:
<SCRIPT>
//set variable
var MyValue1="TEST Value"
var MyValue2="TEST Value"
document.write("<form name='test'>");
document.write("<select size=1 name=options onchange=test.text1.value=test.options.value>");
document.write(" <option>Choose one...</option>");
document.write("<option value="+MyValue1+">option1</option>");
document.write("<option value="+MyValue2+">option2</option>");
document.write("</select>");
document.write("<input type=text name=text1>");
document.write("</form>");
</SCRIPT>
SN
document.write("<option value="+MyValue1+">option1</option>");
document.write("<option value="+MyValue2+">option2</option>");
with this:
document.write('<option value="'+MyValue1+"'>option1</option>"');
document.write('<option value="'+MyValue2+"'>option2</option>"');
this will also validate.
SN