473,396 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

<select> drop down and window.location

41
hi all

i have two dynamic drop downs of dealer id and category id which work properly with window.location

Expand|Select|Wrap|Line Numbers
  1. var dealerid;
  2. function getList(xyz)
  3. {
  4. window.location='manage_products.php?category_id=' + xyz;
  5. }
  6. function getProducts(dealer_id)
  7. {
  8. var catid=document.form1.category.value;
  9. window.location='manage_products.php?dealer_id=' + dealer_id + "&category_id="+catid ;
  10. }
  11.  
but now i want to add static drop down of sub category and make use of window.location which i m not able to do

Expand|Select|Wrap|Line Numbers
  1. <select name="sub_catg" onchange="getSb(this.value)"  id="sub_catg">
  2. <option>Select Sub Category</option>
  3. <option value="Batteries">Batteries</option>
  4. <option value="Leather & PU Cases">Leather &amp; PU Cases</option>
  5. <option value="Crystal & Rubber Coated Cases">Crystal &amp; Rubber Coated Cases</option>
  6. <option value="Car Mounts & USB Cradles">Car Mounts &amp; USB Cradles</option>
  7. <option value="AC Chargers & Car Chargers">AC Chargers &amp; Car Chargers</option>
  8. </select>
  9.  
This is function that is not working
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2. var subid=document.form1.sub_catg.value;
  3. function getSb(subid)
  4. {
  5. window.location='manage_products.php?dealer_id=' + dealer_id + "&category_id="+catid + "&sub_catg=" + subid ;
  6. }
  7. </script>
  8.  
vineet
Jun 17 '09 #1
1 3131
acoder
16,027 Expert Mod 8TB
See how you set catid in getProducts()? You need to do the same thing for catid and dealer_id in getSb() too.

Also, there's no need for the subid line - in fact, it would probably result in a error.
Jun 17 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Darren | last post by:
Please Help Me!! I've created a typical <form> and a <select> element. The options are created dynamically from my access database (using asp). There are about 70 options, and when you click...
3
by: Chamomile | last post by:
I've only just come accross this newsgroup, so apologies if I seem to be cross-posting... this may be an old chestnut, but has anyone ever come accross a straightforward way of styling a...
3
by: gekoblu | last post by:
Hi!, I want to fix via javascript the combo width to a fix value. I'd like to implement a kind of ALT / TITLE function to show the entire option when the text is longer than the combo width......
5
by: Brian Foley | last post by:
Hello, I am used to using the label tag with check boxes and radio buttons in html forms. This allows me to click on the text of the label to activate/deactivate the check box / button, rather...
3
by: i_dvlp | last post by:
I'm trying to replicate a fancy drop-down control (MS-egads!) with form <select><option> It doesn't look like you can specity width as an attribute or define width with CSS. It looks like my...
5
by: Isha | last post by:
Hi all, I wanted to change the background color for only the first option in a select box, but following changed the background color for the whole dropdown box. <select name="alltags"...
4
by: luftikus143 | last post by:
Hi there, I have a nasty little problem, as so often, only with IE. Here is an screenshot to better illustrate the problem. http://geodata.grid.unep.ch/screenshot13.png The map is clickable (to...
7
by: Shrek | last post by:
I have a drop down on a web page and want to change the cursor from default to pointer, so my style definition has style ="cursor: pointer;" the drop down though fails to change from the...
8
by: dkate777 | last post by:
I have a PHP/mySQL database running, and I've realized I'm come across an awkward little bug. I have a form where a user fills out their information using populated drop down boxes. This...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
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...
0
agi2029
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 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.