We work in ASP VBScript pages.
When a check box is ticked at that moment I need to be able to have certain values selected in two drop down lists, so all of this exists at the moment and works but it has to be done manually, since it is all connected it would be good if it had the values selected when the check box was ticked.
I populate values for drop down lists in the following way,select the ID but display the description.
Nature of Problem</H1>
</TD><TD colspan=5 >
<SELECT id=natureOfProblem language=javascript onkeypress="return HandleTypeAhead(window.thisForm.natureOfProblem)">
<OPTION value="0"> </OPTION>
<%
Dim rsProblems
set rsProblems = CreateObject("ADODB.recordset")
call rsProblems.Open("SELECT Value, Description FROM Trim.dbo.viewZProblems ", myCon)
do while not rsProblems.EOF
Response.Write("<OPTION value=" & rsProblems("Value"))
if rsProblems("Value") = szProblemValue then
Response.Write(" selected")
end if
Response.Write(">" & _
rsProblems("Description") & "</OPTION>" & Chr(10))
rsProblems.MoveNext
loop
rsProblems.Close
%>
</SELECT>
What I was thinking of doing and I can't seem to execute that is to create OnClick() function and assign it to the check box so when it gets checked it selects these values.
Function onchange(){
window.thisForm.option1.value = 'whatever';
window.thisForm.option2.value = 'whatever';
}
So I don't know if this would work and if it would do I assign the number that represents the ID of the value i want to see selected on click.For example if i want to see "blah" selected and blah has an ID of 10 would I do it
"window.thisForm.option1.value = '10'
Could somebody advise me on this please?
When a check box is ticked at that moment I need to be able to have certain values selected in two drop down lists, so all of this exists at the moment and works but it has to be done manually, since it is all connected it would be good if it had the values selected when the check box was ticked.
I populate values for drop down lists in the following way,select the ID but display the description.
Nature of Problem</H1>
</TD><TD colspan=5 >
<SELECT id=natureOfProblem language=javascript onkeypress="return HandleTypeAhead(window.thisForm.natureOfProblem)">
<OPTION value="0"> </OPTION>
<%
Dim rsProblems
set rsProblems = CreateObject("ADODB.recordset")
call rsProblems.Open("SELECT Value, Description FROM Trim.dbo.viewZProblems ", myCon)
do while not rsProblems.EOF
Response.Write("<OPTION value=" & rsProblems("Value"))
if rsProblems("Value") = szProblemValue then
Response.Write(" selected")
end if
Response.Write(">" & _
rsProblems("Description") & "</OPTION>" & Chr(10))
rsProblems.MoveNext
loop
rsProblems.Close
%>
</SELECT>
What I was thinking of doing and I can't seem to execute that is to create OnClick() function and assign it to the check box so when it gets checked it selects these values.
Function onchange(){
window.thisForm.option1.value = 'whatever';
window.thisForm.option2.value = 'whatever';
}
So I don't know if this would work and if it would do I assign the number that represents the ID of the value i want to see selected on click.For example if i want to see "blah" selected and blah has an ID of 10 would I do it
"window.thisForm.option1.value = '10'
Could somebody advise me on this please?