I really hope this makes sense to someone because I really need some assistance with this:
I have a asp page that I am working on that has as many as 4 dropdownlists depending on what I choose in those dropdowns. The 4 dropdowns are named:iSource, iSub1, iSub2, iSub3. To begin I select an item for iSource then iSub1 comes up and I have an option to choose ALL or any of the other items in the recordset. If I choose ALL it will bring up iSub2 which populates everything that I would have chosen for each of the items in iSub1. After selecting ALL and iSub2 dropdown comes up I choose an item from iSub2. This is where the problem happens. Once I select something from iSub2 dropdown it disappears and iSub1 comes back up. What I want it to do once I select something from iSub2 it should show iSub3 dropdown. Based on my code what am I doing incorrectly. I am showing two pieces of code from the page. The first is the html table with each of the dropdowns and the second is the sql recordset statements: - <table width="100%" cellpadding="2" cellspacing="0" border="0">
-
<tr>
-
<td>
-
Select a Source:
-
<select name="cboSource" id="cboSource" onchange="cboSourceChange()">
-
<option value="0"></option>
-
<% While Not rsSource.EOF%>
-
<option value="<%=rsSource("iParameterId")%>"
-
<%if cLng(rsSource("iParameterId")) = cLng(iSource) then response.Write " Selected " %>>
-
<%=rsSource("vchParameterDesc")%>
-
</option>
-
<% rsSource.MoveNext
-
wend
-
%>
-
</select>
-
(<%=iSource%>)
-
</td>
-
</tr>
-
<tr>
-
<td>
-
<% if iSource <> "0" then %>
-
Select a Source Sub 1:
-
<% if not rsSub1.EOF then %>
-
<select name="cboSub1" id="cboSub1" onchange="cboSub1Change()">
-
<option value="0"></option>
-
<option value="1">ALL</option>
-
<% While Not rsSub1.EOF%>
-
<option value="<%=rsSub1("iParameterId")%>"
-
<%if cLng(rsSub1("iParameterId")) = cLng(iSub1) then response.Write " Selected " %>>
-
<%=rsSub1("vchParameterDesc")%>
-
</option>
-
<%
-
rsSub1.MoveNext
-
wend
-
%>
-
</select>
-
(<%=iSub1%>)
-
<% else
-
response.Write "No Source Sub 1 options defined."
-
end if %>
-
</td>
-
</tr>
-
<tr>
-
<td>
-
<% if iSub1 <> "0" then %>
-
Select a Source Sub 2:
-
<% if not rsSub2.EOF then %>
-
<select name="cboSub2" id="cboSub2" onchange="cboSub2Change()">
-
<option value="0"></option>
-
<% While Not rsSub2.EOF%>
-
<option value="<%=rsSub2("iParameterId")%>"
-
<%if cLng(rsSub2("iParameterId")) = cLng(iSub2) then response.Write " Selected " %>>
-
<%=rsSub2("vchParameterDesc")%>
-
</option>
-
<%rsSub2.MoveNext
-
wend
-
%>
-
</select>
-
nbsp;(<%=iSub2%>)
-
<% else
-
response.Write "No Source Sub 2 options defined."
-
end if %>
-
</td>
-
</tr>
-
<tr>
-
<td>
-
<% if iSub2 <> "0" then %>
-
Select a Source Sub 3:
-
<% if not rsSub3.EOF then %>
-
<select name="cboSub3" id="cboSub3" onchange="cboSub3Change()">
-
<option value="0"></option>
-
<% While Not rsSub3.EOF%>
-
<option value="<%=rsSub3("iParameterId")%>"
-
<%if cLng(rsSub3("iParameterId")) = cLng(iSub3) then response.Write " Selected " %>>
-
<%=rsSub3("vchParameterDesc")%>
-
</option>
-
<%
-
rsSub3.MoveNext
-
wend
-
%>
-
</select>
-
(<%=iSub3%>)
-
<% else
-
response.Write "No Source Sub 3 options defined."
-
end if %>
-
<% end if
-
end if
-
end if %>
-
</td>
-
</tr>
-
</table>
- ' Get a recordset of the primary sources for an Onyx Sales Opportunity
-
sql = "Select iParameterId, vchParameterDesc from ReferenceDefinition " & _
-
"where iReferenceId = 11 and tiRecordStatus = 1 and iParentId = 3 order by vchParameterDesc"
-
-
Set rsSource = Server.CreateObject("ADODB.Recordset")
-
rsSource.Open sql, cnOnyx, 0, 1
-
' If a source was selected, get a list of the sub source 1 options.
-
If iSource <> "0" then
-
sql = "Select iParameterId, vchParameterDesc from ReferenceDefinition " & _
-
"where iReferenceId = 641 and tiRecordStatus = 1 and iParentId = " & iSource & _
-
" order by vchParameterDesc"
-
Set rsSub1 = Server.CreateObject("ADODB.Recordset")
-
rsSub1.Open sql, cnOnyx, 0, 1
-
' If a sub source 1 is selected, get a list of sub source 2 options.
-
-
'M006A Begin
-
If iSub1 <> "0" then
-
If iSub1 = "1" then
-
sql = "Select iParameterId, vchParameterDesc from ReferenceDefinition " & _
-
"where iReferenceId = 642 and tiRecordStatus = 1" & _
-
" order by vchParameterDesc"
-
else
-
sql = "Select iParameterId, vchParameterDesc from ReferenceDefinition " & _
-
"where iReferenceId = 642 and tiRecordStatus = 1 and iParentId = " & iSub1 & _
-
" order by vchParameterDesc"
-
-
end if
-
-
Set rsSub2 = Server.CreateObject("ADODB.Recordset")
-
rsSub2.Open sql, cnOnyx, 0, 1
-
Set rsSub2 = Server.CreateObject("ADODB.Recordset")
-
rsSub2.Open sql, cnOnyx, 0, 1
-
-
if not rsSub2.eof then
-
rsSub2.MoveFirst
-
-
end if
-
-
'end if
-
'M006A End
-
' If a sub source 2 is selected, get a list of sub source 3 options.
-
If iSub2 <> "0" then
-
-
sql = "Select iParameterId, vchParameterDesc from ReferenceDefinition " & _
-
"where iReferenceId = 643 and tiRecordStatus" & _
-
"order by vchParameterDesc"
-
-
Set rsSub3 = Server.CreateObject("ADODB.Recordset")
-
rsSub3.Open sql, cnOnyx, 0, 1
-
-
End If
-
'response.Write(sql)
-
' response.End()
-
End If
-
-
End If
1 1436 jhardman 3,406
Recognized Expert Specialist
This isn't really an asp question, it all depends on the javascript functions (cboSub1Change etc) that open the selects. I bet if you look carefully you aren't tracking the names of the controls carefully.
Anyway, if you need more help, I would post in the javascript forum.
Jared
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Marc |
last post by:
I've gotten everything up and running except for this -- I'd like to
be able to have people have a dropdown list of cities in the US to use
(or wherever) and not have to input them manually into a text field.
When you do then there are issues of misspellings, etc.
Now I have a list of cities from each state that is a sample that
works in an html page. Problem is that it takes up 2 MB! Way too much
to load on a single page and I was...
|
by: Tony Grider |
last post by:
I am trying to find a way to create dependent dropdown lists in C# The old
way I knew involved javascript and will no longer work in the new design. I
need for each list to be database driven (data is pulled from database)
Example:
First Box would have Years 2004, 2003, 2002, 2001, etc.
Second Box: would have Ford, Chevy, Dodge, Toyota, Honda, etc
Third Box would have items based from first selelction(if Ford chosen)
F-150, Explorer,...
|
by: Mike O. |
last post by:
MS Access 2003 "filter by form" has drop down lists that allow the
user to select values for each field to filter by. However, once some
values are selected,the remaining dropdown lists remain the same and
aren't progressively filtered to reflect the selections already made
in other fields. This can be very tedious when filtering a large
datasheet. Unlike Access, the MS Excel autofilter has automatic
progressive filtering of value...
|
by: Henke |
last post by:
Hi,
I have done some research about my problem I have
when using the "back button" in IE to go back to a
page with two dropdown lists.
The both dropdown lists
are populated with data. The first dropdown lists is
redirecting the user to another page (building a querystring
for the second page to use) and when the back button
|
by: Chris Becker |
last post by:
This is my attempt to rephrase a question I asked earlier that got no
response. I suspect it was my poor/unplanned wording. Here is another
attempt:
I have a form with some drop down lists. I would like the user to be able
to start filling in the form, then get to one of the dropdown lists (ex:
Service Type) and realize that the dropdown list does not contain the entry
that they need. So next to the Service Type drop down list is a...
| |
by: Anthony |
last post by:
So I've got three dropdowns in a datagrid footer (to add records). I need
them to cascade, in the first one I have three choices, in the second one I
have anywhere from 3 to 10 choices, depending on what is selected in the
first one, etc, etc.
Whats happening is that when the auto-postback occurs, it fires the event
for the dropdownlist change, which calls the Getxxx routines that update the
dropdownlist's datasource to the new datatable...
|
by: Ed Chiu |
last post by:
Hi,
I have 2 dropdown lists on an ASP.Net page, the first is a list of states of
US, the second is City list. When user selects a state, the web page does a
postback, create a DB connection and bind a dataset to city dropdown list.
This is working for me.
But I would like to do this on the client side for the following reasons:
(1) Doing this on server side takes time, the postback and connecting to DB
costs too much.
|
by: cgian31 |
last post by:
I have implemented a website where in a page are represented the data
of one record, using cascade dropdown lists in 2 levels, within the
same page/record.
According to the selection in the first dropdown (parent), the
available choices in the second one (child) change.
It works pretty well, except for the fact that when I retrieve an
existing record the second dropdown list is not correctly updated to
display the entry selected at the...
|
by: Lair |
last post by:
I am creating a page that has three to four databound dropdown lists.
Each one is has different data sometimes from the same table but with a
different where clause. What is the best way to populate the data
onload? Right now it's opening and closing a connection for each
dropdown list/Query. I would like to find a way that I can do all the
queries at once without having to open and close the connection several
times. I am using mysql/...
|
by: eddie23 |
last post by:
Hi group.
we've an ASP.net application. there are dropdown lists all over it. we use IE6 SP2 here in work. When the dropdown is accessed by someone logged in as a local admin to the XP workstation the dropdown appears as a long list (which is great in that you don't need to scroll). BUT when a regular user is logged in, IE behanves differently in that it displays a smaller window to show the list's contents and has a vertical scrollbar for...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |