I have a drop down menu which has a list of subcategories and the
initial value is "please choose a Subcategory". When the user chooses a
subcategory they are taken to a new page where the drop down list shows
the selected subcategory in the menu. So far that is working.
The problem is that when the list is showing the subcategory on the
second page there are now two of that item in the list and the initial
item that should be available in the drop down is missing.
In other words in the initial drops down the user has the following
options,.
Choose a subcategory
shoes
boots
slippers
The user chooses boots
Then on the following page which is the boots subcategory the list
looks like this.
boots
boots
slippers
I would love some help. Here is the code:
---------------------------------------------------------------------------------
'The Department for which we are loading the categories
Dim BrandID As String = Request.QuerySt ring("brandID")
Dim CategoryID As String = Request.QuerySt ring("CategoryI D")
Dim strSubCategory As String =
Request.QuerySt ring("strSubCat egory")
'choosing if it is a brand or category - each pulls from a different
database table
If Not IsPostBack Then
If Not CategoryID Is Nothing Then
list.DataSource = Catalog.GetSubC atsinCats(Categ oryID)
list.DataBind()
'lblsubnav.Text = CategoryID
'If there is no subcategory in the querystring then you have the
"Please choose a subcategory" and the initial list. Otherwise you
have the selected item showing
HERE IS THE PROBLEM!
If Not strSubCategory Is Nothing Then
list.SelectedIt em.Text = strSubCategory
Else
list.Items.Inse rt(0, "Please choose a subcategory")
End If
'repeats for brands
ElseIf Not BrandID Is Nothing Then
list.DataSource = Catalog.GetSubC atsInBrands(Bra ndID)
list.DataBind()
If Not strSubCategory Is Nothing Then
list.SelectedIt em.Text = strSubCategory
Else
list.Items.Inse rt(0, "Please choose a subcategory")
End If
Else
' lblsubnav.Visib le = False
list.Visible = False
' label.Visible = False
End If
End If
----------------------------------------------------------------- 4 1528
If Not strSubCategory Is Nothing Then You are subtituting shoes for boots !?! <<<
list.SelectedIt em.Text = strSubCategory
Else
list.Items.Inse rt(0, "Please choose a subcategory")
End If
--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Laura K" <kl*****@charte r.net> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .I have a drop down menu which has a list of subcategories and the initial value is "please choose a Subcategory". When the user chooses a subcategory they are taken to a new page where the drop down list shows the selected subcategory in the menu. So far that is working.
The problem is that when the list is showing the subcategory on the second page there are now two of that item in the list and the initial item that should be available in the drop down is missing.
In other words in the initial drops down the user has the following options,.
Choose a subcategory shoes boots slippers
The user chooses boots
Then on the following page which is the boots subcategory the list looks like this.
boots boots slippers
I would love some help. Here is the code:
---------------------------------------------------------------------------------
'The Department for which we are loading the categories
Dim BrandID As String = Request.QuerySt ring("brandID") Dim CategoryID As String = Request.QuerySt ring("CategoryI D") Dim strSubCategory As String = Request.QuerySt ring("strSubCat egory")
'choosing if it is a brand or category - each pulls from a different database table
If Not IsPostBack Then If Not CategoryID Is Nothing Then
list.DataSource = Catalog.GetSubC atsinCats(Categ oryID) list.DataBind() 'lblsubnav.Text = CategoryID
'If there is no subcategory in the querystring then you have the "Please choose a subcategory" and the initial list. Otherwise you have the selected item showing
HERE IS THE PROBLEM!
If Not strSubCategory Is Nothing Then list.SelectedIt em.Text = strSubCategory Else list.Items.Inse rt(0, "Please choose a subcategory") End If
'repeats for brands
ElseIf Not BrandID Is Nothing Then list.DataSource = Catalog.GetSubC atsInBrands(Bra ndID) list.DataBind() If Not strSubCategory Is Nothing Then list.SelectedIt em.Text = strSubCategory Else list.Items.Inse rt(0, "Please choose a subcategory") End If Else
' lblsubnav.Visib le = False list.Visible = False ' label.Visible = False
End If
End If
-----------------------------------------------------------------
Not sure what you mean. Can you give me an idea of what the actual
correct code would be?
OK fixed it a bit but now I have a new problem. I changed
list.SelectedIt em.Text = strSubCategory
to
list.Items.Inse rt(0, strSubCategory)
This works fine except I get the text twice. Once on the top of the
list where the user can see it when the page loads and a second time in
the list itself where it nornally is.
The problem is that your sub catagory is the same name as the first item in
the list. You dont need to add this at all as far as I can see as once you
have selected the subcategory, you now have the list ( of sub categories )
that you need,so Im not sure why are you trying to add it in ?
Unless I have misunderstood you ?
--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Laura K" <kl*****@charte r.net> wrote in message
news:11******** *************@i 39g2000cwa.goog legroups.com... OK fixed it a bit but now I have a new problem. I changed
list.SelectedIt em.Text = strSubCategory to
list.Items.Inse rt(0, strSubCategory)
This works fine except I get the text twice. Once on the top of the list where the user can see it when the page loads and a second time in the list itself where it nornally is. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mike Wilcox |
last post by:
I use the following code snippet to build a drop down menu with the
results of a query. How can I set the initial value of this input based
on the result of another query?
What I am trying to do is update records in the data base. The field
WkEndDate is pulled along with the rest of the record and the drop down
menu is built from a table of valid WkEndDate values.
echo ("Weekend Date: <select name='WkEndDate'/> ");
|
by: Greg Scharlemann |
last post by:
I am attempting to populate a drop down menu based on the selection of
a different drop down menu. However, it is not working correctly, I
cannot figure out for the life of me what exactly happens because I am
not getting any errors on the page.
<html>
<script language="javascript">
var phaseArray = new phaseArray(4);
var phaseTypeId = new phaseTypeId(4);
var phaseId = new phaseId(4);
|
by: Greg Scharlemann |
last post by:
I would like to automatically populate a drop down menu when the page
loads based on the selection of an item in a different drop down menu.
I made a test page that when drop down #1 changes, drop down #2
populates. Does anyone know how to get drop down #2 to populate based
on what is selected in drop down #1 when the page loads?
Here is my test code:
************************************************************************
<html>...
|
by: mart2006 |
last post by:
I've created a dynamic drop down menu that populates itself with data from a MySQL table. What I would like to do is create a non dynamic drop down menu that alters what is shown in the dynamic menu.
For example, the first menu has three cities London, Paris, New York. If I choose London it populates the second menu with people from London.
Here is the code I have for my dynamic menu
<td valign=top><strong>Name:</strong></td>
<td>...
|
by: phpnewb |
last post by:
Hi, I know i'm doing it wrong, but I'm using a while loop right now to create several instances of a drop down menu. It gives me undesirable results. Can you tell me the right way to do it. Below are a bit of information on what i did if you want t read it.
When I choose select an option in the drop down menu and hit submit, I increase a counter, and a 2nd loop generates a second drop down menu with the same options. This is exactly what...
| |
by: Boujii |
last post by:
Greetings, I have been attempting to make a drop down menu of countries. From this menu I wish to create a variable in order to INPUT into mysql database. I have no trouble making the drop down menu, but I am unable to store a variable for it.
Here is a rough copy of what I am making:
<html>
<head>
<title>Add New MySQL User</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
|
by: Kaland |
last post by:
Do the search engines follow links that are within
forms (like the drop-down menu) so that those pages are indexed?
Here is the code for a sample drop-down menu that I created.
<form><select name="menu" style="font-family:'Calligrapher';color:#993333;background-color:#FFFFFF;font-size:10pt;"><option value="http://www.localwebsolutions.com/local-business-marketing-online.html">Marketing Online</option><option...
|
by: phpnewbie26 |
last post by:
My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created the problem that when I went to select the other drop down menus, the selections i made on the multiple select one would clear. Then I had tried putting the multiple select menu last so that the selections wouldn't clear but then after clicking the...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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...
| |