JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 20th, 2001, 07:42 AM
spmfreeman spmfreeman is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 28 spmfreeman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

Hi,

I´m sorry I had to get your attention that way ( ), but I have a very urgent question:

I created a pop-up window Y from the main window X, and now I want to make it possible to select a link from a pull-down menu in Y - and the page should appear in X.

Right now I use this form:

<SCRIPT language="JavaScript">
<!--
function fenster()
{
opener.location.href = "../domain/"
}
//-->
</SCRIPT>

and this pull-down:

<select name=site SIZE=1 onChange="fenster(this.form)">
<option value="http://www.yoursite.com">Go to....
<option value="http://www.yahoo.com">Yahoo
<option value="http://www.metacrawler.com">Metacrawler
<option value="http://www.altavista.digital.com">Altavista
<option value="http://www.webcrawler.com">Webcrawler
<option value="http://www.lycos.com">Lycos
<option value="http://javascript.internet.com">JavaScript Source
</select>
</form>

but now I only get to ../domain, doesn´t matter what option I select.

Is it possible to modify this script to use for my purpose (right now it creates a pop-up, but it might help):

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function formHandler(form) {
var windowprops = "height=500,width=500,location=no,"
+ "scrollbars=no,menubars=no,toolbars=no,resizable=yes";

var URL = form.site.options[form.site.selectedIndex].value;
popup = window.open(URL,"MenuPopup",windowprops);
}
// End -->
</script>

Could you please help me and tell me the code to use?

Thanks so much,
steve

Reply With Quote
  #2  
Old March 20th, 2001, 08:02 AM
webtendon webtendon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Hatboro, PA
Posts: 11 webtendon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You aren't using the value passed to fenster(). You are passing "this.form" as an argument to the function fenster() so you need to do something with it:

<SCRIPT language="JavaScript">
<!--
function fenster(arg)
{
opener.location.href = arg
}
//-->
</SCRIPT>

Reply With Quote
  #3  
Old March 20th, 2001, 08:11 AM
spmfreeman spmfreeman is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 28 spmfreeman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks, but...

I want to keep the target url out of the <SCRIPT>...</SCRIPT>, the url should be taken from the <FORM>

How can I do that?

Reply With Quote
  #4  
Old March 20th, 2001, 01:27 PM
JohnB JohnB is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2001
Location: UK
Posts: 527 JohnB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
If you call the function with 'this' instead of 'this.form' you will be passing the drop down list instead of the form.

Then your function becomes:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function formHandler(dropdown) {
var windowprops = "height=500,width=500,location=no,"
+ "scrollbars=no,menubars=no,toolbars=no,resizable=yes";

var URL = dropdown.options[dropdown.selectedIndex].value;
popup = window.open(URL,"MenuPopup",windowprops);
}
// End -->
</script>

I think this is what you need.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Javascript masters please help

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap