Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-12-2004, 03:40 AM   PM User | #1
ImperialSpider
Regular Coder

 
Join Date: Jan 2004
Location: San Antonio, TX
Posts: 131
Thanks: 1
Thanked 0 Times in 0 Posts
ImperialSpider is an unknown quantity at this point
Question how to add more menu options in dropdowns?

I am trying to vary the use of the script found at: http://www.javascriptkit.com/script/...plecombo.shtml

I am wanting to have 5 items in the first dropdown menu, as many as 8 items in the second dropdown menu, and up to 15 items in the third dropdown menu. Everytime I try to add the items, I get a coding error in my browsers (I.E. 6.0-sp1) lower left hand corner, and the script will not work. I am changing the numbers to allow for the next set of values, and following the sequences exactly as shown by the script, but still not able to make this work. I am also wanting to know if it is possible for me to add a Search bar which would work in conjunction with this script. An example of what I am looking for would be to have the following.

dropdown menu (5 items)
dropdown menu (8 items)
dropdown menu (15 items)
search bar (searches a specific website using dropdown menu or independantly)
Go! button (performs requested search)

Any assistance provided would be greatly appreciated.

You may reply directly to my email (crazyhorse30@excite.com) if you want, or I will be checking back here every day or so to hopefully find my answer.

Again, Thanks for any assistance.

Imperial Spider
ImperialSpider is offline   Reply With Quote
Old 01-12-2004, 06:06 AM   PM User | #2
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
Double-click that exclamation icon to see the details of the error. And could you post some related codes?
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 01-13-2004, 05:52 AM   PM User | #3
ImperialSpider
Regular Coder

 
Join Date: Jan 2004
Location: San Antonio, TX
Posts: 131
Thanks: 1
Thanked 0 Times in 0 Posts
ImperialSpider is an unknown quantity at this point
Glenn,

Thanks for asking me those questions, Actually, I went to read the error message that came up, and found one of the major problems, so for now, at least it is working.

I do however have one other part of my question that I would like to have answered...I currently have the code set up to automatically go to the website upon selecting the option from the 3rd dropdown. I would like to place a "Go!" button at the bottom of the third dropdown menu, and have that send the user to the site. I also would like to add a general site navigation Search bar below the 3rd dropdown, but above the Go! button, which would work in conjuction with the dropdown menus, or could act all on its on to search for key words within a website.

My code is way to long to post on here, so here is where I have temporarily put it up on a friends server, so that anyone who can help me, can have a better understanding of what I am doing, to tell me what I still need to do.

Again, Any assistance is Greatly Appreciated.


The site is http://www.tweedscott.com/ImperialSpider.html


Again, Thanks in advance,

Imperial Spider
ImperialSpider is offline   Reply With Quote
Old 01-13-2004, 07:05 AM   PM User | #4
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
Remove the onchange handler in the 3rd combo:

<select name="stage3" size="1" onChange="redirect2(this.options.selectedIndex)">

Then add this button:

<input type="button" value="Go!" onclick="redirect2()">

And change the redirect2() function to:

function redirect2(){
if (temp1.selectedIndex>0) window.location.href=temp1.options[temp1.selectedIndex].value;
}
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 01-14-2004, 12:42 AM   PM User | #5
ImperialSpider
Regular Coder

 
Join Date: Jan 2004
Location: San Antonio, TX
Posts: 131
Thanks: 1
Thanked 0 Times in 0 Posts
ImperialSpider is an unknown quantity at this point
Glenn,

I now have a "Go!" button, Thanks!

But for some reason the code is showing up on the webpage, and the Go! button does not work. I copied and pasted directly from your script. Got any ideas as to what I may be doing wrong? Also, would you be able to assist me with putting up a search bar between the third dropdown menu, and the "Go!" button to search an "in TRA net" website -vs- the entire "In TER net"?

If you could help me out with this, it would mean a great deal to me.

I left the change on the site... the Website once again is...

http://www.tweedscott.com/ImperialSpider.html

Thanks again for all of your help,


Imperial Spider
ImperialSpider is offline   Reply With Quote
Old 01-14-2004, 12:53 AM   PM User | #6
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
What you did was:

<select name="stage3" size="1"><input type="button" value="Go!" function redirect2(){
if (temp1.selectedIndex>0) window.location.href=temp1.options[temp1.selectedIndex].value;
}

Do you know html and javascript?

I said that the button should be:

<input type="button" value="Go!" onclick="redirect2()">

And then change the existing redirect2() function from:

function redirect2(z){
window.location=temp1[z].value
}

to:

function redirect2(){
if (temp1.selectedIndex>0) window.location.href=temp1.options[temp1.selectedIndex].value;
}
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 01-14-2004, 01:31 AM   PM User | #7
ImperialSpider
Regular Coder

 
Join Date: Jan 2004
Location: San Antonio, TX
Posts: 131
Thanks: 1
Thanked 0 Times in 0 Posts
ImperialSpider is an unknown quantity at this point
Glenn,

Many Many Thanks!!!

Your scripting knowledge did fix my errors. I sincerely thank you.

I am actually pretty good with basic HTML, but I just started learning Javascript about 3 1/2 weeks ago. I am starting to get the hang of the very BASICS of it, but I do realize that I still have very very much to learn. However, I am getting there - slowly but surely thanks to great people like you.

Again, I thank you for your assistance.


Any Ideas about the search bar??


Imperial Spider
ImperialSpider is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:14 AM.


Advertisement
Log in to turn off these ads.