The below line opens a selected index from a drop down in a browser window. The form field is in a div called "contents". I need to know the syntax needed to open this selection in another div on the same page called "main". The "_top" location opens the file in a new window. I want to open this on the same page. Do I need javascript for this?
Here is all the code for my file:Code:onchange="window.open(this.options[this.selectedIndex].value,'_top')" style="text-align: center">
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Untitled 1</title> <style type="text/css"> .banner { background-color: #000000; width: 100%; height: 25px; } .contents { width: 180px; height: 560px; background-color: #0000FF; } .main { width: 100%; height: 100%; background-color: #006600; } </style> </head> <body> <div id="banner" class="banner"> </div> <div id="contents" class="contents"> <form action="../"> <br /> <select onchange="window.open(this.options[this.selectedIndex].value,'_blank')" style="text-align: center"> <option value="">Choose a destination...</option> <option value="http://www.directpaintsaleswa.com/brianschmit/WXRECORDS/images/yearly/Portland1981-2010.png">CLIMATE</option> <option value="http://www.directpaintsaleswa.com/brianschmit/WXRECORDS/images/yearly/2011.png">2011</option> <option value="http://www.altavista.com/">ALTAVISTA</option> <option value="http://www.amazon.com/">AMAZON</option> <option value="http://artlung.com/">ARTLUNG</option> </select> </form> </div> <div id="main" class="main" style="position: absolute; width: 1148px; height: 564px; z-index: 1; top: 43px; left: 192px"> </div> </body> </html>


Reply With Quote
Bookmarks