I have a function as below in javascript that gets all the values from different inputs/selects. It must then build up a string that will be passed to a textarea.
This was working fine last night when I tested. I then tweaked something, not sure what I did and of course as per Murphy, it won't work anymore...
<script type="text/javascript">
function updateText() {
var sel1= document.getElementById('vehicleyear');
var sel2= document.getElementById('make');
var sel3= document.getElementById('model');
var sel4= document.getElementById('der');
var sel5= document.getElementById('price');
var sel6= document.getElementById('mileage');
var sel7= document.getElementById('colour');
var sel8= document.getElementById('intcolour');
var sel9= document.getElementById('bodytype');
var sel10= document.getElementById('condition');
var sel11= document.getElementById('features');
var selValue1 = sel1.options[sel1.selectedIndex].value;
var selValue2 = sel2.options[sel2.selectedIndex].value;
var selValue3 = sel3.options[sel3.selectedIndex].value;
var selValue4 = sel4.options[sel4.selectedIndex].value;
var selValue5 = document.getElementById('price').value;
var selValue6 = document.getElementById('mileage').value;
var selValue7 = sel7.options[sel7.selectedIndex].value;
var selValue8 = sel8.options[sel8.selectedIndex].value;
var selValue9 = sel9.options[sel9.selectedIndex].value;
var selValue10 = sel10.options[sel10.selectedIndex].value;
var selValue11 = document.getElementById('features').value;
var selValue = selValue1 + " " + selValue2 + " " + selValue3 + " " + selValue4 + " with only " + selValue6 + " kilometers, selling for ONLY R " + selValue5 + ". This " + selValue10 + " " + selValue7 + " with " + selValue8 + " interior " + selValue2 + " " + selValue3 + " has the following features - " + selValue11 + ".";
alert(selValue);
document.form1.comments.value = selValue;
//I have 2 forms on my page. The form containing comments is called frmadd. I changed form1 to frmadd, still no luck. I have added onchange, onblur, onclick in my textarea, no luck. it was working fine with onchange last night. :(
}
</script>
<form action="" name="frmadd" id="frmadd" method="POST" class="innertable">
<textarea cols="50" rows="15" name="comments" id="comments" style="background-color:transparent; border:groove; color:#FFF" onclick="updateText()" onblur="updateText()" onFocus="updateText()">
</textarea>
</form>