What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Dropdown boxes

Pages: (2): « First [ 1 ] 2 » Last »
Dropdown boxes
Author: Message:
user27089
Disabled Account


Posts: 6321
Joined: Nov 2003
Status: Away
O.P. Dropdown boxes
OKay, I have the code sorted out for a dropdown box, but it doesn't change when I select them, I don't want a button, because it looks ugly, I would like the page to change when I select the certain item.

code:
<p align="right">
<form name="form1">
  <select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<option style="color:gray;">Select your language here</option>
    <option value="english/index.html">English</option>
</select>

</form>
</p>

03-14-2005 06:08 PM
Profile PM Find Quote Report
L. Coyote
Senior Member
****

Avatar
Captain Obvious

Posts: 981
Reputation: 49
38 / Male / Flag
Joined: Aug 2004
Status: Away
RE: Dropdown boxes
And what is the code for MM_jumpMenu()?

Something like this is often used to do that:

code:
onchange="self.location=document.form1.menu1.options[this.selectedIndex].value;"

You can change self for the name of the frame/window.

Hack, hack, hack!
Finally became a Systems Analyst! :spam:

03-14-2005 06:24 PM
Profile PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: Dropdown boxes
code:
<script type="text/javascript">
function changelanguage(){
var selectedItem=document.form1.menu1.selectedIndex
document.mainframe.src = "http://http://mpsupport.killercarrot.co.uk/Language/" + selectedItem
}
</script>


<p align="right">
<form name="form1">
<select name="menu1" onChange="changelanguage()">
    <option selected>English</option>
    <option>Welsh</option>
</select>
</form>
</p>


so english would be 0, welsh 1, etc etc...


would it be that hard to ask me once in a while

This post was edited on 03-14-2005 at 06:29 PM by Stigmata.
03-14-2005 06:28 PM
Profile PM Web Find Quote Report
user27089
Disabled Account


Posts: 6321
Joined: Nov 2003
Status: Away
O.P. RE: Dropdown boxes
quote:
Originally posted by Stigmata
would it be that hard to ask me once in a while

:lol: :lol:

Sorry, I'm used to just posting on here :p.

Thanks for your help anyway (y). But, its not in a folder called languages, so that would make it void :p... they're in seperate folders for each language...
03-14-2005 06:30 PM
Profile PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: Dropdown boxes
well rename the language to numbers for simplicity :)


03-14-2005 06:33 PM
Profile PM Web Find Quote Report
user27089
Disabled Account


Posts: 6321
Joined: Nov 2003
Status: Away
O.P. RE: Dropdown boxes
hmm, so where do I add this, I really am not that good yet, so can I please have details on how to do it?
03-14-2005 07:18 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Dropdown boxes
<html>

  <head>
    <title>blah</title>
    <script type="text/javascript">
      function changelanguage(fMenu) {
        var iSelectedItem = fMenu.selectedIndex
        var sLanguage = fMenu.options[iSelectedItem].value;
    //  If you're using frames (eg: you have a frame called TestFrame):
        parent.TestFrame.location.href = "http://blah.com/" + sLanguage + "/help.htm";
    //  If you're not using frames:
    //  document.location.href = "http://blah.com/" + sLanguage + "/help.htm";
      }
    </script>
  </head>

  <body>
    <form name="form1">
      <select name="menu1" onChange="changelanguage(this)">
        <option selected value="en">English</option>
        <option value="we">Welsh</option>
      </select>
    </form>
  </body>

</html>


* do not use the 'item name' as the attribute to get to your pages. Use the 'item value' instead as some language names can/will contain invalid characters for URLs. Also this is much more versitile; you don't need to update all your page urls if you change the language name a bit...

* do not use '.src', use '.location.href' for compatibily reasons

* with the use of 'this' in the form, you assign the current object's name. Much more versitile then adding it in your script directly (eg: you can have multiple menu's, and yet only 1 function)



PS: this is nothing new, but the host killercarrot.co.uk has had always had serieus troubles in their DNS updates (or whatever). I know many people who can access that site, including me.  And this isn't the first time this happened, the other sites hosted on killercarrot had problems in the past also.

This post was edited on 03-14-2005 at 07:32 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-14-2005 07:24 PM
Profile PM Find Quote Report
user27089
Disabled Account


Posts: 6321
Joined: Nov 2003
Status: Away
O.P. RE: Dropdown boxes
      parent.TestFrame.location.href = "http://blah.com/" + sLanguage + "/help.htm";
    //  If you're not using frames:
    //  document.location.href = "http://blah.com/" + sLanguage + "/help.htm";

what do I change them to? just http://mpsupport.killercarrot.co.uk ?
03-14-2005 07:30 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Dropdown boxes
quote:
Originally posted by traxor
parent.TestFrame.location.href = "http://blah.com/" + sLanguage + "/help.htm";
    //  If you're not using frames:
    //  document.location.href = "http://blah.com/" + sLanguage + "/help.htm";

what do I change them to? just http://mpsupport.killercarrot.co.uk ?
like I said, I (just like many others) can't access your site... I really suggest to get another host. The problem I'm experiencing atm is nothing new and happens regulary with killercarrot.co.uk...


But if you're not using frames it would be:
  document.location.href = "http://mpsupport.killercarrot.co.uk/" + sLanguage + "/index.html";

and depending on the values in the list (eg: "en", "we") you need to have your pages at:
http://mpsupport.killercarrot.co.uk/en/index.html
http://mpsupport.killercarrot.co.uk/we/index.html

note: '//' are comment lines in javascript

This post was edited on 03-14-2005 at 07:37 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-14-2005 07:34 PM
Profile PM Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
RE: Dropdown boxes
quote:
Originally posted by CookieRevised
like I said, I (just like many others) can't access your site... I really suggest to get another host. The problem I'm experiencing atm is nothing new and happens regulary with killercarrot.co.uk...

how long have u been having problems accessing killercarrot?  is it just the last month or so?

This post was edited on 03-14-2005 at 07:53 PM by Dempsey.
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
03-14-2005 07:50 PM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On