Problem with javascript for pop-up window
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   mada_geogeo
Posted On:   Friday, November 14, 2003 12:25 PM

function goUrl(formObj){ var urlList = (formObj.id=="form1")?formObj.urlListA:formObj.urlListB; document.location.href = urlList.options[urlList.selectedIndex].value; window.open(urlList.options[urlList.selectedIndex].value,"newWin","width=580,height=500,scrollbars,"); //--> ]]>]]> I was wondering if anybody can help me figure out what's wrong with my script. What I want to accomplish is to let viewers choose from a drop down menu and then click "go". A pop-up window should appear. My problem is that the page (storelocator.htm) where the drop down menu is located changes to display the same page as what is in the pop-up window(e.g: alaska.htm) I want the page storelocator.htm to show the drop down menu and have the pop-up window display    More>>

I was wondering if anybody can help me figure out what's wrong with my script. What I want to accomplish is to let viewers choose from a drop down menu and then click "go". A pop-up window should appear. My problem is that the page (storelocator.htm) where the drop down menu is located changes to display the same page as what is in the pop-up window(e.g: alaska.htm) I want the page storelocator.htm to show the drop down menu and have the pop-up window display store names and address in the State selected.

Any help is really appreciated. Thanks

Madageo





Here is a link to my page:



http://www.kiddiecargo.com/storelocator.htm



here is the script I use:
























   <<Less

Re: Problem with javascript for pop-up window

Posted By:   Jerry_Lampi  
Posted On:   Friday, November 14, 2003 01:10 PM

Found a few problems, but the main one was line:
document.location.href = urlList.options[urlList.selectedIndex].value;


I commented this out and it works.





"HTML Tidy for Windows (vers 1st April 2002), see www.w3.org">
















You should be able to cut and paste this code in its entirety, as it is unchanged except for a few things (function was missing closing brace "}", button defined as type submit rather than button, etc.).
About | Sitemap | Contact