Discussion:
Unable to retieve data from drop down list in a form
(too old to reply)
hoppers
2006-11-14 10:09:10 UTC
Permalink
Hi All.

I have an ASP form which is requesting data and the posting the data to
ADSI. Before i post the form i am running some VBScript to qualify the
data.
I am able to retrieve the data from text field ("DeskNumber") but not
the select drop down field ("title").

I have listed an example (thisis not the whole code) of what i am doing
below

Can anyone tell me what i am doing wrong.

Thanks





<HTML><HEAD>
<TITLE>Update My Info</TITLE>
<form name="UpdateInfo" method="POST" action="UpdateMyInfo.asp"">

<script language="VBScript">
Function RunSubmit()
msgbox
document.forms("UpdateInfo").item("title").value
msgbox
document.forms("UpdateInfo").item("DeskNumber").value
End Function
</script>

<table border="0" width="100%">
<tr>
<td width="19%"><font face="Arial"></font> </td>
<td width="27%"><font color="#0000FF">PRESENT
INFORMATION</font></td>
<td width="54%"></td>
</tr>

<tr>
<td width="19%"><font face="Arial">Title:&nbsp;&nbsp;</font> </td>
<td width="27%"><%= (title)%></td>
<td width="54%"><font face="Arial"><select size="1" name="Title">
<option><%= (title)%></option>
<option>Assistant Vice president</option>
<option>Senior Specialist</option>
<option>Vice Preseident</option>
</select></font></td>
</tr>
<tr>
<td width="19%"><font face="Arial">Desk Number:</font></td>
<td width="27%"><%= (streetaddress)%></td>
<td width="54%"><font face="Arial"><input type="text"
name="DeskNumber" size="20">&nbsp;&nbsp;<font size="2"
color="#0000FF"> </font></font>
</td>
</tr>
</table>

<p>&nbsp;</p>
<p>
<input name="SubmitButton" type="button" value="SUBMIT"
onclick="RunSubmit">

</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

</HTML>
McKirahan
2006-11-16 02:02:54 UTC
Permalink
Post by hoppers
Hi All.
I have an ASP form which is requesting data and the posting the data to
ADSI. Before i post the form i am running some VBScript to qualify the
data.
I am able to retrieve the data from text field ("DeskNumber") but not
the select drop down field ("title").
I have listed an example (thisis not the whole code) of what i am doing
below
Can anyone tell me what i am doing wrong.
[snip]

Try this instead:

document.forms("UpdateInfo").item("title").options[document.forms("UpdateInf
o").item("title").selectedIndex].value

Loading...