Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Trouble with a dynamic dropdown populating a session variable

Guest
Apr 25, 2007 Apr 25, 2007

Copy link to clipboard

Copied

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.
TOPICS
Server side applications

Views

233
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 25, 2007 Apr 25, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 25, 2007 Apr 25, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines