Javascript Help Needed

This is a strange request for me, but I am dead tired today, and have been working on and banging my head against this for too long today, and I need to get this done.

I have a form that has a drop down list of church denominations fed from a database (except for one hard coded option). I want a document.write method to happen if the selection is “UMC”. The sample code is below

<select name=”selDenom”
onchange=”GetDenomSel(document.form.selDenom.options[document.form.selDenom.selectedIndex].value);”>
<option value=”UMC”<United Methodist>/option>

<%
While (NOT rsGetDenom.EOF)
%>
<option value=”<%=(rsGetDenom.Fields.Item(“denList”).Value)%>” <%If (Not isNull((rsGetDenom.Fields.Item(“denList”).Value))) Then If (CStr(rsGetDenom.Fields.Item(“denList”).Value) = CStr((rsGetDenom.Fields.Item(“denList”).Value))) Then Response.Write(“SELECTED”) : Response.Write(“”)%> ><%=(rsGetDenom.Fields.Item(“den”).Value)%></option>

<%
rsGetDenom.MoveNext()
Wend
If (rsGetDenom.CursorType > 0) Then
rsGetDenom.MoveFirst
Else
rsGetDenom.Requery
End If
%>
</select>
</p>
<p>
<script language=”JavaScript” type=”text/JavaScript”>
if (document.form.selDenom.options[document.form.selDenom.selectedIndex].value) = ‘UMC’)
{document.writeln(‘UMC selected’)}
else
{document.writeln(‘UMC NOT selected’)}

</script>

The data items are simply additoonal items for the Options in the select list. The javascript to pull the value of the selected item , to see if it is “UMC”, is what I cannot seem to get to work and fire off the document.writeln.

This is like a desperation stab ih the dark in case some of you out there are javascript gurus (I am not , obviously). I’d like to be able to use inline javascript, but can use functions. Any ideas? I would be grateful.

Leave a Reply