|
-
Script controling dropdown, loading link in 2nd window
I have a JavaScript which processes the contents/selection of a dropdown box,
loading the associated URL or page.
This works fine.
However what I want is for the URL/Page to load in the main window/frame
(not a new window but one already on screen) and not the current, contents
one.
I have tried using target in various ways with no success.
Pardon any 'dullness', it's my first ever venture into JavaScript
Example of Script is.
<SCRIPT>
/* comments in JavaScript here */
function change_site()
{var
site=document.myform.mypopup.selectedIndex;
if (confirm('Are you sure you want to change site? ' + site))
{if (site==1) {
window.location.href=document.myform.mypopup.options[site].text; }
else {
window.location.href=document.myform.mypopup.options[site].value;} }
}
</SCRIPT>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks