The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

2-Level combo box Help!

3 posters

Go down

In progress 2-Level combo box Help!

Post by Sir. Mayo September 11th 2013, 10:55 pm

Ok!
So i tried adding this to my forum:
http://www.javascriptkit.com/script/script2/2levelcombo.shtml

But when i do it all that shows up is place holder content, and when I'm On and Html Editor its Normal and works fine but does not when i place it on my fourm!
heres's the code:
Code:
<form name="dynamiccombo">
<select name="stage2" size="1" onChange="displaysub()">
<option value="#">This is a place Holder text </option>
<option value="#">This is a Place Holder text </option>
<option value="#">This is a Place Holder text </option>
<option value="#">This is a Place Holder text </option>
</select>
<input type="button" name="test" value="Go!"
onClick="gothere()">
</form>

<script>
<!--

//2-level combo box script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use

//STEP 1 of 2: DEFINE the main category links below
//EXTEND array as needed following the laid out structure
//BE sure to preserve the first line, as it's used to display main title

var category=new Array()
category[0]=new Option("SELECT A CATEGORY ", "") //THIS LINE RESERVED TO CONTAIN COMBO TITLE
category[1]=new Option("Webmaster sites", "combo1")
category[2]=new Option("News sites", "combo2")
category[3]=new Option("Entertainment", "combo3")

//STEP 2 of 2: DEFINE the sub category links below
//EXTEND array as needed following the laid out structure
//BE sure to preserve the LAST line, as it's used to display submain title

var combo1=new Array()
combo1[0]=new Option("JavaScript Kit","http://javascriptkit.com")
combo1[1]=new Option("Dynamic Drive","http://www.dynamicdrive.com")
combo1[2]=new Option("Freewarejava.com","http://www.freewarejava.com")
combo1[3]=new Option("Free Web Templates","http://www.freewebtemplates.com")
combo1[4]=new Option("Web Monkey","http://www.webmonkey.com")
combo1[5]=new Option("BACK TO CATEGORIES","")   //THIS LINE RESERVED TO CONTAIN COMBO SUBTITLE

var combo2=new Array()
combo2[0]=new Option("CNN","http://www.cnn.com")
combo2[1]=new Option("MSNBC","http://www.msnbc.com")
combo2[2]=new Option("BBC News","http://news.bbc.co.uk")
combo2[3]=new Option("ABC News","http://www.abcnews.com")
combo2[4]=new Option("BACK TO CATEGORIES","")   //THIS LINE RESERVED TO CONTAIN COMBO SUBTITLE

var combo3=new Array()
combo3[0]=new Option("Hollywood.com","http://www.hollywood.com")
combo3[1]=new Option("MTV","http://www.mtv.com")
combo3[2]=new Option("ETOnline","http://etonline.com")
combo3[3]=new Option("BACK TO CATEGORIES","")   //THIS LINE RESERVED TO CONTAIN COMBO SUBTITLE

var curlevel=1
var cacheobj=document.dynamiccombo.stage2

function populate(x){
for (m=cacheobj.options.length-1;m>0;m--)
cacheobj.options[m]=null
selectedarray=eval(x)
for (i=0;i<selectedarray.length;i++)
cacheobj.options[i]=new Option(selectedarray[i].text,selectedarray[i].value)
cacheobj.options[0].selected=true

}

function displaysub(){
if (curlevel==1){
populate(cacheobj.options[cacheobj.selectedIndex].value)
curlevel=2
}
else
gothere()
}


function gothere(){
if (curlevel==2){
if (cacheobj.selectedIndex==cacheobj.options.length-1){
curlevel=1
populate(category)
}
else
location=cacheobj.options[cacheobj.selectedIndex].value
}
}

//SHOW categories by default
populate(category)

//-->
</script>

<p align="center">This free script provided by<br />
<a href="http://javascriptkit.com">JavaScript
Kit</a></p>
Can i please get some help?
Sir. Mayo
Sir. Mayo
Forumember

Male Posts : 980
Reputation : 90
Language : English, Some french.
Location : you can also reach me on snoonet's irc server. I idle in #Techsupport Username is Vault108

http://sir-mayo.forumotion.com/

Back to top Go down

In progress Re: 2-Level combo box Help!

Post by SLGray September 11th 2013, 11:44 pm

That is just a jump box which all forum versions have.

See if this is similar - https://help.forumotion.com/t41195-drop-down-list


2-Level combo box Help! Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51464
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: 2-Level combo box Help!

Post by Sir. Mayo September 12th 2013, 1:49 am

No thats not what i was looking for! For example
It will list staff members names the when a staff member name is picked it Will Then jump to a menu with Pm, Email and the choose from there! Is that understanable?
Sir. Mayo
Sir. Mayo
Forumember

Male Posts : 980
Reputation : 90
Language : English, Some french.
Location : you can also reach me on snoonet's irc server. I idle in #Techsupport Username is Vault108

http://sir-mayo.forumotion.com/

Back to top Go down

In progress Re: 2-Level combo box Help!

Post by SLGray September 12th 2013, 2:11 am

Where are you adding this, and what is your forum's version?


2-Level combo box Help! Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51464
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: 2-Level combo box Help!

Post by Sir. Mayo September 12th 2013, 2:36 am

I have tried it in my Index_body and my Portal_body as well as an HTML document!  
Phbb2
Edit:
Heres a html page with the code on it:
http://sir-mayo.forumotion.com/h8-code-help
See how its saying place holder text it should look like this:
2-Level combo box Help! Screen18
Sir. Mayo
Sir. Mayo
Forumember

Male Posts : 980
Reputation : 90
Language : English, Some french.
Location : you can also reach me on snoonet's irc server. I idle in #Techsupport Username is Vault108

http://sir-mayo.forumotion.com/

Back to top Go down

In progress Re: 2-Level combo box Help!

Post by SLGray September 12th 2013, 6:15 am

I tried it on my forum in the homepage message and it worked. 

Did you edit the parts that can be edited?


2-Level combo box Help! Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51464
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: 2-Level combo box Help!

Post by Sir. Mayo September 12th 2013, 12:34 pm

I think heres my edited code:
Code:
<form name="dynamiccombo">
<select name="stage2" size="1" onChange="displaysub()">
<option value="#">This is a place Holder text </option>
<option value="#">This is a Place Holder text </option>
<option value="#">This is a Place Holder text </option>
<option value="#">This is a Place Holder text </option>
</select>
<input type="button" name="test" value="Go!"
onClick="gothere()">
</form>

<script>
<!--

//2-level combo box script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use

//STEP 1 of 2: DEFINE the main category links below
//EXTEND array as needed following the laid out structure
//BE sure to preserve the first line, as it's used to display main title

var category=new Array()
category[0]=new Option("Contact Us ", "") //THIS LINE RESERVED TO CONTAIN COMBO TITLE
category[1]=new Option("Sir.Mayo", "combo1")
category[2]=new Option("Zyon ", "combo2")
category[3]=new Option("Mr.Mustard", "combo3")

//STEP 2 of 2: DEFINE the sub category links below
//EXTEND array as needed following the laid out structure
//BE sure to preserve the LAST line, as it's used to display submain title

var combo1=new Array()
combo1[0]=new Option("Email","mailto:sir.mayo@yahoo.com")
combo1[1]=new Option("PM ","http://sir-mayo.forumotion.com/privmsg?mode=post&u=1")
combo1[2]=new Option("BACK TO CATEGORIES","")  //THIS LINE RESERVED TO CONTAIN COMBO SUBTITLE

var combo2=new Array()
combo2[0]=new Option("PM","http://sir-mayo.forumotion.com/privmsg?mode=post&u=3")

combo2[1]=new Option("BACK TO CATEGORIES","")  //THIS LINE RESERVED TO CONTAIN COMBO SUBTITLE

var combo3=new Array()
combo3[0]=new Option("PM","http://sir-mayo.forumotion.com/privmsg?mode=post&u=2")


combo3[1]=new Option("BACK TO CATEGORIES","")  //THIS LINE RESERVED TO CONTAIN COMBO SUBTITLE

var curlevel=1
var cacheobj=document.dynamiccombo.stage2

function populate(x){
for (m=cacheobj.options.length-1;m>0;m--)
cacheobj.options[m]=null
selectedarray=eval(x)
for (i=0;i<selectedarray.length;i++)
cacheobj.options[i]=new Option(selectedarray[i].text,selectedarray[i].value)
cacheobj.options[0].selected=true

}

function displaysub(){
if (curlevel==1){
populate(cacheobj.options[cacheobj.selectedIndex].value)
curlevel=2
}
else
gothere()
}


function gothere(){
if (curlevel==2){
if (cacheobj.selectedIndex==cacheobj.options.length-1){
curlevel=1
populate(category)
}
else
location=cacheobj.options[cacheobj.selectedIndex].value
}
}

//SHOW categories by default
populate(category)

//-->
</script>

<p align="center">This free script provided by<br />
<a href="http://javascriptkit.com">JavaScript
Kit</a></p>
Sir. Mayo
Sir. Mayo
Forumember

Male Posts : 980
Reputation : 90
Language : English, Some french.
Location : you can also reach me on snoonet's irc server. I idle in #Techsupport Username is Vault108

http://sir-mayo.forumotion.com/

Back to top Go down

In progress Re: 2-Level combo box Help!

Post by levy September 12th 2013, 1:09 pm

I'm comfuse , what you really want ?
You want to make a tab and there to be name of staff and if you click on someone name , will redirect you to send him a PM ?
levy
levy
Hyperactive

Male Posts : 2632
Reputation : 350
Language : English, Romanian
Location : Romania

https://portofolio.goodforum.net/

Back to top Go down

In progress Re: 2-Level combo box Help!

Post by Sir. Mayo September 12th 2013, 4:03 pm

Yes There should be two options one for A pm and one for an email!
But let me try in in my home page message and see if that works!
Sir. Mayo
Sir. Mayo
Forumember

Male Posts : 980
Reputation : 90
Language : English, Some french.
Location : you can also reach me on snoonet's irc server. I idle in #Techsupport Username is Vault108

http://sir-mayo.forumotion.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum