javascript problem

PHaRGoTH

Newcomer
Joined
Apr 29, 2004
Messages
7
Hi all...

I know that this is probably not not the most indicated forum to post this but some friends of mine said that the best place i could get a hand his here.

Im currently trying to create a web-page where i have this combo-box that is suposed to change the content of a cell in a table in that same page...
right now what a have is this:

<select size="6" id="madeira" name="made" onchange="ficheiro=this.options[this.selectedIndex].value">

<option value="especies/AFIZELIA.html">AFIZÉLIA</option>
<option value="especies/AFROMOSIA.html">AFROMÓSIA</option>
...
<tr>
<td> target url must apear here </td>
now this redirects me to the target page.. what must i do to meake it apear on the cell?

tnx!
 
You could give your <td> tag an id and then refer to in using javascript:

<td id="mycell"></td>

and then use this to change the cell contents:

document.getElementById("mycell").innerHTML = "<a href="wherever.com">clickme</a>";

This should give you a start in the right direction...
 
hi...
ok i followed you indications, and some other stuff i find on the internet, and i came up with this script:

function openURL()
{

selInd = document.madeiras.madeira.selectedIndex;

goURL = document.madeiras.madeira.options[selInd].value;

incluir = "<!-- #include file="' + goURL + '"-->";

document.getElementById("celula").innerHTML = incluir;

}

but now it blows everytime i try to run the page, saying that he cant find the file goURL...

i think he tries to put some file when he starts the page, becouse if put him to write the file, as soon as i choose something in the combo-box he returns the right path...

i already try to put a default include in the cell but it still blows :(
 
problem solved.. using includes was a bat idea...

iframe was the solution

...
document.getElementById("celula").innerHTML = "<iframe src='" + goURL +"'></iframe>";
 
Back
Top