New Page

User 123570 Photo


Registered User
73 posts

Greetings,

Below you will see code for a drop down menu which works nicely but I would like to open these Selections in a new Blank Page. How can I pass this parameter, where and what parameter do I pass to achieve this? Thanks and God Bless...

<form name="language">
<select name="menu">
<option value="http://www.tranexp.com:2000/Translate/result.shtml">InterTran</option>
<option value="http://babelfish.altavista.com/tr">Babel Fish</option>
</select>
<input type="button" onClick="top.location=document.language.menu.options[document.language.menu.selectedIndex].value;" value="Language Translators/Dictionaries">
</form>

Reverend William
Which Came First Coffee or the Cup?
User 132952 Photo


Ambassador
3,120 posts

I may not be understanding the scenario, but I'd imagine after creating a new blank page that you could copy & paste the code into the new page just as you did for your post. I copied & pasted that paragraph of code into a blank page (in the body of the code editor not visual editor) and saw the dropdown & button myself.
User 123570 Photo


Registered User
73 posts

Hi Adam,

Yes, The Drop Down Menu works fantastic Yes indeed. Hope it helps folks, but i am sumped on one last thing. Once you select where to go with the Menu selection I want the URL to open in a new window so the menu selection resides in one and the coorosponding URL Selection when clicked will open up into a new window all together. Sorry if I was not too Clear Hey Thanks!
Which Came First Coffee or the Cup?
User 123570 Photo


Registered User
73 posts

Instead of when you select the URl of Choice, which translator you wish to go to, and it opening in the default window already open in your browser, It would be fantastic if it would start a new instance and open a new window when loading the URL of Choice Thanks!
Which Came First Coffee or the Cup?
User 132952 Photo


Ambassador
3,120 posts

Hey, try this out:

<form name="menuform">
<select name="menu">
<option value="http://www.tranexp.com:2000/Translate/result.shtml" selected>InterTran</option>
<option value="http://babelfish.altavista.com/tr">Babel Fish</option>
</select>
<input type="button" name="Submit" value="Go"
onClick="window.open(menuform.menu.options[menuform.menu.selectedIndex].value);
return false;">
</form>
User 132668 Photo


Registered User
92 posts

William Middleton wrote:
Instead of when you select the URl of Choice, which translator you wish to go to, and it opening in the default window already open in your browser, It would be fantastic if it would start a new instance and open a new window when loading the URL of Choice Thanks!

Are you familiar with the target attribute?

As an example, target="_blank" will open a new window. I am not an experienced coder but that's what I learned from Nick's book (page 72). Try it and have fun.
Conrado
------------------------------------------------------
People will not always remember what you tell them but
they will never forget what you make them feel.
User 117361 Photo


Ambassador
6,076 posts

Conrado Caunan wrote:
William Middleton wrote:
Instead of when you select the URl of Choice, which translator you wish to go to, and it opening in the default window already open in your browser, It would be fantastic if it would start a new instance and open a new window when loading the URL of Choice Thanks!

Are you familiar with the target attribute?

As an example, target="_blank" will open a new window. I am not an experienced coder but that's what I learned from Nick's book (page 72). Try it and have fun.

S'cuse my stepping in here - and maybe not even being sure where the conversation started, but I will just make a couple of points which may have been overlooked, and may be useful.
1.For every new page you wish to open, it must obviously exist as a new HTML page and be saved as such with its own name (in the same directory as all the other site content)
2.When you create your menu, you must obviously direct the menu items to the name of the new page you wish to open in a new window, but without all the full URL http:// etcetcetc, but simply with the name of the page (for instance home.html) and the menu and all its files must be save in the same directory.
3. If you wish to create a target within a page, first of all you must create the target. That is to say, select the area of the page you wish to be targeted, and give that target a name. So in your home page (for instance), perhaps you would like to target an area called ABOUT US, so you go into the code and select one or 2 words at that point in the page then from the tool bar INSERT > TARGET and then give your target a name, such as "about" Obviously all a target is, is a link within a page as opposed to being a linked page.
4. So when you then wish to set up a link to that target, in the menu you will no longer just put in home.html, but you will write home.html#about and save.
5. You will naturally have to add the "about us" in to your menu as a sub-item under the home item which will drop down according to what kind of menu making program you are using.

Don't know if any of this helped, but hope so,
Janys
User 132952 Photo


Ambassador
3,120 posts

Good stuff, but in this case, the links to new windows are from different sites so the pages already exist and need full paths. Also, this code to create a new window is in a <form>, and the standard target code doesn't quite work the same in this code (from what I tried anyway). For William's specific question, I believe I created the exact code that will load the two desired pages in a new window.
User 117361 Photo


Ambassador
6,076 posts

Adam Richesin wrote:
Good stuff, but in this case, the links to new windows are from different sites so the pages already exist and need full paths. Also, this code to create a new window is in a <form>, and the standard target code doesn't quite work the same in this code (from what I tried anyway). For William's specific question, I believe I created the exact code that will load the two desired pages in a new window.

Hang on, let's see if this code works from the CC site to pick up a target in my site:

http://www.giudecca-homes.com/events.html#may

I shall try, and this might solve the target issue.
Janys

10 seconds later - yes it works, so the target should read something like my code as a link.
As for the rest, seems I stuck my nose in at an inopportune moment, so I shall step back.......
User 123570 Photo


Registered User
73 posts

Adam Richesin wrote:
Hey, try this out:

<form name="menuform">
<select name="menu">
<option value="http://www.tranexp.com:2000/Translate/result.shtml" selected>InterTran</option>
<option value="http://babelfish.altavista.com/tr">Babel Fish</option>
</select>
<input type="button" name="Submit" value="Go"
onClick="window.open(menuform.menu.options[menuform.menu.selectedIndex].value);
return false;">
</form>

Hey Adam Thanks and appreciate the Help--it works just dandy. To each of the others, thank you all for your help. each one of you are very well appreciated. Thanks and God Bless!
Which Came First Coffee or the Cup?

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.