Need help with Select Options fill Textarea with selected messages
Greeting the forum;
Here is my current code for the select box on the form page:
<select name="Proposals" onchange="loadComments()">
<option selected>Choose a Proposal here</option>
<option>Proposal A </option>
<option>Proposal B </option>
<option>Proposal C </option>
<option>Proposal D </option>
Any help will be appreciated. Thanks in advance.
//var f1 = document.form.Proposals.selectedIndex
var f1 = document.form.Proposals[document.form.Proposals.selectedIndex].value
var f2 = document.form.Comments
var txt1 = "Testing the script for Proposal A"
var txt2 = "Testing the script for Proposal B"
var txt3 = "Testing the script for Proposal C"
var txt4 = "Testing the script for Proposal D"
if (f1 = 1)
f2.value = txt1
else if (f1 = 2)
f2.value = txt2
else if (f1 = 3)
f2.value = txt3
else if (f1 = 4)
f2.value = txt4