473,387 Members | 1,493 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,387 software developers and data experts.

javascript drop downs

Please take a look at this code. It doesn't work (I'm no __Javascript person).... Could you make the neccesary changes to make it work.

Just trying to refresh the page with the selected values in the URL.

Thanks!


<!-- Hide from tired old browsers this is used for the select link
Expand|Select|Wrap|Line Numbers
  1. function GetMgrNo() {
  2. window.location.href="home_ml.asp?company_no=188&contact_no=" + window.document.form_selections.contact_no.options(window.document.form_selections.contact_no.selectedIndex).value ;
  3. }
  4.  
  5. function GetSubNo() {
  6. window.location.href="home_ml.asp?company_no=188&contact_no=" + window.document.form_selections.contact_no.options(window.document.form_selections.contact_no.selectedIndex).value + "&contact_id=" + window.document.form_selections.contact_id.options(window.document.form_selections.contact_id.selectedIndex).value ;
  7. }
  8. // end hiding ---> 
  9.  
</SCRIPT>


[HTML]<select name="contact_no" class="smaller" onfiltered="GetMgrNo()">
<option value="0">All Managers</option>
<option value="1">Jim</option>
<option value="2">Hank</option>
<option value="3">Kim</option>
</select>

If not request("contact_no") = "" then

<select name="contact_id" class="smaller" onfiltered="GetSubNo()">
<option value="10">All Subs</option>
<option value="8">Ham</option>
<option value="7">Cheese</option>
<option value="6">Eggs</option>
</select>

end if[/HTML]
Sep 30 '06 #1
1 1208
acoder
16,027 Expert Mod 8TB
Two problems:
1. Replace ( and ) with [ and ]:
Expand|Select|Wrap|Line Numbers
  1. function GetMgrNo() {
  2. window.location.href="home_ml.asp?company_no=188&contact_no=" + window.document.form_selections.contact_no.options[window.document.form_selections.contact_no.selectedIndex].value ;
  3. }
or you could even use something like:
Expand|Select|Wrap|Line Numbers
  1. function GetMgrNo() {
  2. window.location.href="home_ml.asp?company_no=188&contact_no=" + window.document.form_selections.contact_no.value ;
  3. }
2. It's onchange, not onfiltered:
[HTML]<select name="contact_no" class="smaller" onchange="GetMgrNo()">[/html]
May 19 '08 #2

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

Similar topics

46
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") ...
2
by: Mark Sargent | last post by:
Hi All, I want to pull data from a number of tables, Categories, SubCategroies and then place into JavaScript drop downs and have the options in the second drop down change upon the selection...
1
by: Joe Dunleavy | last post by:
Hi Guys, Hopefully some one will have come across this issue already. I have a DataGrid inside a Div where a scroll bar displays once a certain height is meet --> <div id="dvSales"...
3
by: CSharpguy | last post by:
I have 3 drop downs that are populated from the databasem 4 of my web pages need to have this drop down, how can I trap the selection made in the drop down and popuate my grid on my form?
24
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to...
4
by: Adam Smith | last post by:
Hello, How can I call or trigger an external javascript twice in a form? I have <script language="JavaScript" src="country_state.js" name="Country_State"> <script type="text/javascript"...
2
by: John | last post by:
I have CSS drop down navigatoon bar and it works fine. However, when I have page where I have an <embed - needed to show a PDF file, such as: <embed src="Security.pdf" width="900"...
2
by: Jake Barnes | last post by:
I've been asked to help out with the navigation bar on this page: http://www.thesecondroad.org/ The drop down menu (which is pure CSS, save for a fix for IE) appears behind the Flash module....
1
by: JackInDaBox | last post by:
Hello, I am new to this and have run into a small problem. I am using the Ajax toolkit with VS 2005 to fill some drop downs through a web service and it works great. All of the cascading drop...
1
by: scott | last post by:
Hello, Thanks in advance for any help you might be able to offer... I have an html table with two columns and 10 rows. The first column contains a textbox that is populated. The second column...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...
0
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,...

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.