I have a form that displays data from the database. In this form I have a field that is a dropdown list:
Code: Select all
<div id='subform_grade_udetails0026l332t598' style='position:absolute;top:598px;left:332px'>
<select name="subform_grade_udetails0026udetails_cos" id="subform_grade_udetails0026udetails_cos" class="objects" style="width:80px;" onchange="untick('subform_grade_udetails0026', this);uDB(this);calcStatus();" onfocus="nuSetRow('subform_grade_udetails0026');" >
<option value=''></option>
<option value='Failed'>Failed</option>
<option value='Passed'>Passed</option>
</select>
</div>
Code: Select all
document.getElementById('subform_grade_udetails0026udetails_cos').value= 'Failed';
Is this the correct way to assign a value to a dropdown field?
Thank you!
Rui