PDA

View Full Version : drop menu in iframe not new page



mailtosaleh
08-05-2007, 07:35 PM
I have this drop menu script
It works fine but with one problem
I need the new page to appear in an Iframe, I1, not in a new page or _blank

I tried to change

if (new_page != "0") { window.location = new_page ; return true; }
to
if (I1 != "0") { window.location = I1 ; return true; }
But it gives error

The script is
______----_____
<HTML>

<HEAD>
</HEAD>
<base target="I1">

<p>
</p>
<table border="1" width="100%" id="table1">
<tr>
<td width="513">
<iframe name="I1" width="422" height="273" scrolling="no" border="0" frameborder="0" src="please_chose.htm" align="left" style="text-align: center; padding: 0">Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe></td>
<td valign="top"><SCRIPT language=JavaScript>

function jRoute_onChange(form_elem) {

nav_name = navigator.appName;

if (nav_name != "Netscape") { new_page = eval("document.selections." + form_elem + ".value"); }

else { optionIndex = eval("document.selections." + form_elem + ".selectedIndex");

new_page = eval("document.selections." + form_elem + ".options[" + optionIndex + "].value"); }

if (new_page != "0") { window.location = new_page; return true; }

return false; }

</SCRIPT>

<FORM name=selections>

<select name=AllCountriesAG
onChange="jRoute_onChange('AllCountriesAG');">

<option selected value=0>All Countries A - G</option>
<option value="antarctica.htm">Antarctica</option>
<option value="afgan.htm">Afghanistan</option>
<option value="albania.htm">Albania</option>
<option value="algeria.htm">Algeria</option>
<option value="samoaame.htm">American Samoa</option>
<option value="andorra.htm">Andorra</option>
<option value="angola.htm">Angola</option>
<option value="antigua.htm">Antigua &amp; Barbuda</option>
<option value="argentin.htm">Argentina</option>
<option value="armenia.htm">Armenia</option>
<option value="aruba.htm">Aruba</option>
<option value="ascencio.htm">Ascencion Island</option>
<option value="australi.htm">Australia</option>
<option value="austria.htm">Austria</option>
<option value="azerbaij.htm">Azerbaijan</option>
<option value="bahamas.htm">The Bahamas</option>
<option value="bahrain.htm">Bahrain</option>
<option value="baltics.htm">The Baltics</option>
<option value="banglade.htm">Bangladesh</option>
<option value="barbados.htm">Barbados</option>
<option value="basque.htm">Basque Country</option>
<option value="belarus.htm">Belarus</option>
<option value="belgium.htm">Belgium</option>
<option value="belize.htm">Belize</option>
<option value="benin.htm">Benin</option>
<option value="bermuda.htm">Bermuda</option>
<option value="bhutan.htm">Bhutan</option>
<option value="bolivia.htm">Bolivia</option>
<option value="bosnia.htm">Bosnia Herzegovina</option>
<option value="botswana.htm">Botswana</option>
<option value="brazil.htm">Brazil</option>
<option value="bvi.htm">British Virgin Islands</option>
<option value="brunei.htm">Brunei</option>
<option value="bulgaria.htm">Bulgaria</option>
<option value="burkinaf.htm">Burkina Faso</option>
<option value="burundi.htm">Burundi</option>
<option value="cambodia.htm">Cambodia </option>
<option value="cameroon.htm">Cameroon</option>
<option value="canada.htm">Canada</option>
<option value="capeverd.htm">Cape Verde</option>
<option value="cayman-islands.htm">Cayman Islands</option>
<option value="carepub.htm">Central African Republic</option>
<option value="chad.htm">Chad</option>
<option value="chanisla.htm">Channel Islands</option>
<option value="chile.htm">Chile </option>
<option value="china.htm">China </option>
<option value="colombia.htm">Colombia </option>
<option value="cnmi.htm">C'wealth Nrth Mariana Is</option>
<option value="comoros.htm">Comoros</option>
<option value="congo.htm">Congo-Brazzaville</option>
<option value="costaric.htm">Costa Rica</option>
<option value="cotedivo.htm">Côte D'Ivoire</option>
<option value="croatia.htm">Croatia</option>
<option value="cuba.htm">Cuba</option>
<option value="cyprus.htm">Cyprus</option>
<option value="czech_re.htm">Czech Republic</option>
<option value="drcongo.htm">Democ. Rep. of Congo</option>
<option value="denmark.htm">Denmark </option>
<option value="dominica.htm">Dominica</option>
<option value="domrep.htm">Dominican Republic</option>
<option value="djiboute.htm">Djiboute</option>
<option value="east-timor.htm">East Timor</option>
<option value="ecuador.htm">Ecuador </option>
<option value="egypt.htm">Egypt</option>
<option value="elsalvad.htm">El Salvador </option>
<option value="englanda-k.htm">England A to K</option>
<option value="englandl-z.htm">England L to Z</option>
<option value="equatori.htm">Equatorial Guinea</option>
<option value="estonia.htm">Estonia </option>
<option value="ethiopia.htm">Ethiopia</option>
<option value="eritrea.htm">Eritrea</option>
<option value="falklands.htm">Falklands-Malvinas</option>
<option value="faroeis.htm">Faroe Islands</option>
<option value="fiji.htm">Fiji</option>
<option value="finland.htm">Finland </option>
<option value="france.htm">France </option>
<option value="fpolynes.htm">French Polynesia</option>
<option value="gabon.htm">Gabon</option>
<option value="gambia.htm">Gambia</option>
<option value="georgia.htm">Georgia</option>
<option value="germany.htm">Germany </option>
<option value="ghana.htm">Ghana</option>
<option value="gibralt.htm">Gibraltar </option>
<option value="greece.htm">Greece </option>
<option value="greenlan.htm">Greenland</option>
<option value="grenada.htm">Grenada</option>
<option value="guatemal.htm">Guatemala </option>
<option value="guadelou.htm">Guadeloupe</option>
<option value="guinea.htm">Guinea</option>
<option value="guineabi.htm">Guinea-Bissau</option>
<option value="guyana.htm">Guyana</option>
<option>_____________________</option>
</select>
</td>
</tr>
</form></td>
</tr>
</table>
</body>
</html>
---------------
Any help is really appreciated
Thank you

jscheuer1
08-05-2007, 10:28 PM
if (new_page != "0") { window.frames['I1'].location = new_page; return true; }

mailtosaleh
08-06-2007, 12:06 AM
Thanks,
It works great