Hi,
I am stuck with a problem ….
A user is face with two selections A and B,
[code]
<SELECT ID=”OPTION_A” onChange=”validate()”>
<OPTION SELECTED=”TRUE” VALUE=”-1″>– Please Select Car –</OPTION>
<OPTION VALUE=”Ferrari”>Ferrari</VALUE>
<OPTION VALUE=”Mclaren”>Mclaren</OPTION>
</SELECT>
<SELECT ID=”OPTION_B” onChange=”validate()”>
<OPTION SELECTED=”TRUE” VALUE=”-1″>– Please Select Position–</OPTION>
<OPTION VALUE=”1″>1</VALUE>
<OPTION VALUE=”2″>2</OPTION>
</SELECT>
So before the user can submit the selection i have a check, because if the user has selected “Ferrari”, then he can not select anything from B.
[code]
a = document.getElementById(‘OPTION_A’).value;
b = document.getElementById(‘OPTION_B’).value;
if (a= “Ferrari” && b != “-1”)
{
var result = confirm(“Ferrari cannot choose from option B. Deselect it?”,”Yes”,”No”);
if (result = true)
{
*********************************************
HERE IS MY PROBLEM
I want to be able to then set the value of ELEMENT B to -1
I wish there was a simple function like get but set (setElementById) something on the lines of: setElementById(OPTION_B).value = “-1”
But as far as I am aware there is none…is there a way on setting the option value of the select menu!????
**********************************************
}
else
{
….
}
If anyone can give me any ideas…it will be highly appreciate it!…also, I am just a beginner…so please go easy on me ?