JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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: 9
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


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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT