Skip to main content
April 25, 2007
Question

Trouble with a dynamic dropdown populating a session variable

  • April 25, 2007
  • 1 reply
  • 269 views
Business description: Users choose from a dyanmic drop-down menu, the fields and values of which are set by the database. The non-selected options provide data for a session variable that is compared to values in the database and information is presented accordingly. This works as planned. However, if users leave the initally-selected option chosen, which is ok, I get this error:

ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

It happens that the same information displayed when one of the dynamic options is chosen is also appropriate when the default option is chosen. I have set the value of the default option to be the same value as one of the dynamic drop-downs (that value is $20 adults/$10 kids), and used this IF statement:

<% if (rs_recordset.Fields.Item("Column").value == "$20 adults/$10 kids") { %>
Text here
<% } %>

How do I present specific information on the resulting page if the user leaves the initially-selected option chosen in the drop-down? Thanks.
This topic has been closed for replies.

1 reply

April 25, 2007
You can set a default value of the innitially selected to something and you can then check against that value.

For example:
<select>
<option value="NA" selected="yes">- Select Product -</option>
</select>

IF Form.Field <> "NA" Then
- blah blah blah -
End If

So it's set to NA, do nothing or show a message or whatever you want.
April 25, 2007
Do I put this on the resulting page after the form is submitted?

Also, please set me straight on the syntax; I'm using ASP javascript. Thanks.