Click to See Complete Forum and Search --> : Setting window option for drop down choices


iddif
10-17-2003, 03:46 PM
I have a site designed in Front Page that uses frames. I downloaded a script for a drop down box to send users to different pages on the site. The code as written opens each option in the right hand frame which is fine for all but two options which are links to other sites. Is there anything I can add to this line to get a new window to open with this link?


<option value="http://www.futuretechcom.com/thewave">Wave Youth Ministry</option>

Hope this makes sense.

BestZest
10-17-2003, 04:31 PM
I guess you could cheat the script a little bit. To open a link in a new window, you use target="_blank". So you could change the value to:

value="http://www.futuretechcom.com/thewave\" target=\"_blank\""

(\" escapes the quotation marks, so the string doesn't end at them)

Hope this works

BestZest

iddif
10-17-2003, 09:32 PM
I tried your suggestion but got the following error:

"Redirection limit for this URL exceeded. Unable to load requested page."

Jona
10-17-2003, 09:53 PM
Could you post your JavaScript code and the form with a dropdown, please? (I'd prefer that you exclude all code other than the JavaScript and parts of the form that relate to your question, please.)

[J]ona

iddif
10-17-2003, 09:57 PM
OK Let me try this. I'm new to this so bear with me...

Here is the code:

<form name="b566" target="_blank">
<p align="center" style="margin-top: 5; margin-bottom: 5">
<select name="b516" size="1">
<option selected value="http://www.agwinchester.org/BigHousePage.htm">Big House Kids Ministry</option>
<option value="http://www.agwinchester.org/Celebrate Recovery.htm">Celebrate Recovery</option>
<option value="http://www.agwinchester.org/media ministry.htm">Media Ministry</option>
<option value="http://www.agwinchester.org/mens ministry.htm">Titus 2 Men's Ministry</option>
<option value="http://www.agwinchester.org/military support.htm">Military Support Ministry</option>
<option value="http://www.agwinchester.org/Prayer Ministry.htm">Prayer Ministry</option>
<option value="http://www.agwinchester.org/women_of_the_word.htm">Women Of The Word</option>
</select>&nbsp;
<input type="button" value="Go"
onClick="location=document.b566.b516.options[document.b566.b516.selectedIndex].value"></p>
</form>

iddif
10-17-2003, 10:03 PM
Sorry, I forgot the option that links to the site I want to open in a new window.

Here is the code with that option added:

<form name="b566" target="_blank">
<p align="center" style="margin-top: 5; margin-bottom: 5">
<select name="b516" size="1">
<option selected value="http://www.agwinchester.org/BigHousePage.htm">Big House Kids Ministry</option>
<option value="http://www.agwinchester.org/Celebrate Recovery.htm">Celebrate Recovery</option>
<option value="http://www.agwinchester.org/media ministry.htm">Media Ministry</option>
<option value="http://www.agwinchester.org/mens ministry.htm">Titus 2 Men's Ministry</option>
<option value="http://www.agwinchester.org/military support.htm">Military Support Ministry</option>
<option value="http://www.agwinchester.org/Prayer Ministry.htm">Prayer Ministry</option>
<option value="http://www.agwinchester.org/women_of_the_word.htm">Women Of The Word</option>
<option value="http://www.futuretechcom.com/thewave">Wave Youth Ministries</option>
</select>&nbsp;
<input type="button" value="Go"
onClick="location=document.b566.b516.options[document.b566.b516.selectedIndex].value"></p>
</form>

Jona
10-17-2003, 10:03 PM
I haven't tested this code, but I'm pretty confident that it will work.


<form name="b566" target="_blank">
<p style="margin-top: 5; margin-bottom: 5; text-align: center">
<select name="b516" size="1">
<option selected value="http://www.agwinchester.org/BigHousePage.htm|self">Big House Kids Ministry</option>
<option value="http://www.agwinchester.org/Celebrate Recovery.htm|self">Celebrate Recovery</option>
<option value="http://www.agwinchester.org/media ministry.htm|self">Media Ministry</option>
<option value="http://www.agwinchester.org/mens ministry.htm|self">Titus 2 Men's Ministry</option>
<option value="http://www.agwinchester.org/military support.htm|self">Military Support Ministry</option>
<option value="http://www.agwinchester.org/Prayer Ministry.htm|self">Prayer Ministry</option>
<option value="http://www.agwinchester.org/women_of_the_word.htm|self">Women Of The Word</option>
<option value="http://www.futuretechcom.com/thewave|blank">Wave Youth Ministries</option>
</select>
<input type="button" value="Go"
onclick="target=this.form.b516.options[this.form.b516.options.selectedIndex].value.split('|'); eval(target[1]+'location.href=target[0]');"></p>
</form>


[J]ona

iddif
10-17-2003, 10:38 PM
Thank you Jona,

I tried pasting your code but when I hit "preview" it gives me the actual code text in blue instead of the drop down box. I think I must be doing something wrong.

I probably need to step back and do a little studying of JavaScript before trying to take on something like this.

Thank you all for trying to help.

Frank

Jona
10-17-2003, 10:44 PM
Preview? The button in the code I posted says "Go." Did you copy and paste my code?

[J]ona

iddif
10-17-2003, 10:48 PM
In Front Page, there are tabs at the bottom to display the page in one of three modes, normal, html, and preview.

I placed the page in html mode and pasted the code just as I had done with my original code. When I selected the preview mode, instead of seeing the drop down box with the "go" button, the code itself appeared where the drop down box had been.

Jona
10-17-2003, 10:54 PM
Can I offer you my personal and friendly opinion?

Ditch Front Page.

I really, strongly suggest you learn HTML properly before starting with JavaScript. http://www.w3.org/TR/html4/ is where you can learn HTML, and http://www.w3.org/TR/CSS2/ is where you can learn to use CSS properly. Keep in mind the WCAG 1.0 at http://www.w3.org/TR/WCAG10/ which are guidelines on how to ensure that your documents are accessible by all who browse the Web - including those with disabilities such as dyslexia or blindness.

[J]ona

iddif
10-17-2003, 10:59 PM
Thanks for the advice and for the links. I will check them out. Again, thanks for trying to help.

Jona
10-17-2003, 11:03 PM
I am glad to be of assistance. :)

[J]ona