Click to See Complete Forum and Search --> : Loading pages in an inline frame from a function call


stumpy
12-03-2003, 09:38 AM
Hi
I have a code which works ok, except I would like to load the specified file
in an inline frame (I1) on the page instead of a whole new page if at all
possible - any help appreciated!
Here is the function in the <head>;

<script type="text/javascript">

function go()
{
location=document.forms[0].PropPage.value
}

</script>

....and the code (form) which calls the function later on the page;

<form>
<p align="center">
<select id="PropPage" onchange="go()">
<option>-Select Property Type-
<option value="fincas.htm">Fincas
<option value="villas.htm">Villas
<option value="semidetached.htm">Semi-detached
<option value="apartments.htm">Apartments
<option value="plots.htm">Land plots
<option value="newdevelopments.htm">New Developments
</select>

Thanks in advance

Stumpy

TheBearMay
12-03-2003, 09:46 AM
Give the iframe an ID and then change the location attribute for it.



<script type="text/javascript">

function go()
{
iframeID.location=document.forms[0].PropPage.value
}
...
<iframe id="iframeID"....

stumpy
12-03-2003, 10:42 AM
BRILLIANT! Thanks :)