Hello, I have this script which should populate a drop down box depending on
another drop box. The error is somewhere in this code here, but I can't find
it. Any help would be greatly appreciated!
<script language="javascript">
function subcat(category,subcategory,description)
{
this.category=category;
this.subcategory=subcategory;
this.description=description;
}
function Populate(fldval,frmobj)
{
if(fldval!="")
{
frmobj.drop2.length=0;
frmobj.drop2.options[0]=new Option("Subcategory","");
count=1;
if(quantity[fldval]>0)
{
for(a=0;a<quantity;a++)
{
if(subcategory[a].category==fldval)
{
frmobj.drop2.options[count]=new
Option(subcategory[a].subcategory,subcategory[a].description);
count++;
}
}
}
}
}
subcategory[0] = new subcat(1,1,"Desktops");
subcategory[1] = new subcat(4,2,"RAM");
quantity=2;
</script> 2 2072
Ok, fixed it. I'm so silly!
"Phillip Parr" <no****@here.com> wrote in message
news:Od**************@news-binary.blueyonder.co.uk... Hello, I have this script which should populate a drop down box depending
on another drop box. The error is somewhere in this code here, but I can't
find it. Any help would be greatly appreciated! <script language="javascript">
function subcat(category,subcategory,description) { this.category=category; this.subcategory=subcategory; this.description=description; }
function Populate(fldval,frmobj) { if(fldval!="") { frmobj.drop2.length=0; frmobj.drop2.options[0]=new Option("Subcategory",""); count=1; if(quantity[fldval]>0) { for(a=0;a<quantity;a++) { if(subcategory[a].category==fldval) { frmobj.drop2.options[count]=new Option(subcategory[a].subcategory,subcategory[a].description); count++; } } } } }
subcategory[0] = new subcat(1,1,"Desktops"); subcategory[1] = new subcat(4,2,"RAM"); quantity=2;
</script>
Phillip Parr wrote: Ok, fixed it. I'm so silly!
No; otherwise you wouldn't have fixed it. ;-)
Asking the question is the really helpful part.
--
Bas Cost Budde http://www.heuveltop.org/BasCB
but the domain is nl This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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...
|
by: Terren |
last post by:
I need to be able to edit a drop down box is asp. On my web app I
populate a drop down box from a databse. The user can then select an
option that will then be saved to a Database for example
Mr...
|
by: Miguel Dias Moura |
last post by:
Hello,
i have an ASP.NET / VB page where i have a few 4 groups of Drop Down Lists.
Each group of Drop Down Lists include 3 Drop Down Lists for date such as:
DAY, MONTH, and YEAR.
I don't want...
|
by: SirPoonga |
last post by:
Lets say I have a couple of tables in a database containg car make,
type, and model. I want to create a drop down box that is populated by
the makes. Based on that selection run a query to get...
| |
by: csgraham74 |
last post by:
Hi Guys,
I am currently building a web aplication in ASP.Net. On the onload
event of a page a have a function to populate the many drop down lists
on my page.
I have one parameter table which...
|
by: Miguel Dias Moura |
last post by:
Hello,
i have an ASP.NET / VB page where i have a few 4 groups of Drop Down Lists.
Each group of Drop Down Lists include 3 Drop Down Lists for date such as:
DAY, MONTH, and YEAR.
I don't want...
|
by: Yi Chen |
last post by:
We have a drop down list on a PHP page, with several product names, and
when people click one item, we will refresh the same page with the
product name as parameter, and in turn we want to include...
|
by: penny111 |
last post by:
Hi there,
For my application, i need to have 3 drop down lists
1. drop down list of folder names
2. drop down list of documents in the folder selected
3. drop down list of instances of the...
|
by: dskanth |
last post by:
I have 4 drop down lists, namely Location, country, State and City.
Ex: Location: Asia, Country: India, State: Andhra Pradesh, City: Hyderabad.
If i select any option in the Location drop down...
|
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,...
| |
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...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |
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 ...
|
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...
| |