473,657 Members | 3,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

drop down populate

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="javas cript">

function subcat(category ,subcategory,de scription)
{
this.category=c ategory;
this.subcategor y=subcategory;
this.descriptio n=description;
}

function Populate(fldval ,frmobj)
{
if(fldval!="")
{
frmobj.drop2.le ngth=0;
frmobj.drop2.op tions[0]=new Option("Subcate gory","");
count=1;
if(quantity[fldval]>0)
{
for(a=0;a<quant ity;a++)
{
if(subcategory[a].category==fldv al)
{
frmobj.drop2.op tions[count]=new
Option(subcateg ory[a].subcategory,su bcategory[a].description);
count++;
}
}
}
}
}

subcategory[0] = new subcat(1,1,"Des ktops");
subcategory[1] = new subcat(4,2,"RAM ");
quantity=2;

</script>
Jul 20 '05 #1
2 2077
Ok, fixed it. I'm so silly!

"Phillip Parr" <no****@here.co m> wrote in message
news:Od******** ******@news-binary.blueyond er.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="javas cript">

function subcat(category ,subcategory,de scription)
{
this.category=c ategory;
this.subcategor y=subcategory;
this.descriptio n=description;
}

function Populate(fldval ,frmobj)
{
if(fldval!="")
{
frmobj.drop2.le ngth=0;
frmobj.drop2.op tions[0]=new Option("Subcate gory","");
count=1;
if(quantity[fldval]>0)
{
for(a=0;a<quant ity;a++)
{
if(subcategory[a].category==fldv al)
{
frmobj.drop2.op tions[count]=new
Option(subcateg ory[a].subcategory,su bcategory[a].description);
count++;
}
}
}
}
}

subcategory[0] = new subcat(1,1,"Des ktops");
subcategory[1] = new subcat(4,2,"RAM ");
quantity=2;

</script>

Jul 20 '05 #2
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

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
15406
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);
1
6347
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>...
4
3790
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 Mrs Miss but if the option is not their e.g Dr, Prof etc then I want them to be able to enter in the drop down box and then I will save this to the
3
14216
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 to insert the values and text to each drop down list. So i want to create a script that populates a certain Drop Down List with certain values when page loads such as:
2
1497
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 the types of vehicles that make creates. Then baed off that the models that fit that make and type. Point me in the direction of how to do this. Thanks.
1
2045
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 stores all the values e.g. Title,Type,Status,Property,Occupation. I am using a sql string and then populationg my drop down list
7
6309
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 to insert the values and text to each drop down list. So i want to create a script that populates a certain Drop Down List with certain values when page loads such as:
3
6888
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 a HTML file into the content area of the same page. I know it is recommended to put everything into database, but we want the web site to be very "portable", so the drop-downlist and the content should both in text files. Let's say the...
3
7345
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 document selected (my application uses the BusinessObjects Java Web Services SDK) The 2nd list is dependent on the 1st, while the 3rd list is dependent on the 2nd. In other words, this is what i want my application to do -select a folder from the...
8
3302
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 list, it should populate the country drop down list, and if i select an option in country drop down list, it should populate the state drop down list, and if i select any option in the state drop down list, it should populate the city drop down...
0
8302
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,...
0
8820
Oralloy
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...
0
8718
jinu1996
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...
1
8499
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,...
1
6162
isladogs
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...
0
4150
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...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.