make link no longer a link
Posted: Fri Mar 24, 2006 2:26 am
Ok so I have about 4 textareas and some links above them. When you click the link it makes the appropriate text area appear and the rest disappear. What I want to do is make the link that I clicked on no longer a link (ie, just text) so the person knows what textarea they are using. Here is my code:
edit: I had to change the naming to be standards complient but now it does not work. Here is the new, trying to be standards complient, section:
Code: Select all
<script type="text/javascript">
function show(id, tot)
{
for (i = 0; i < tot; i++)
{
targ = document.getElementById(i);
if (i != id)
targ.style.display = 'none';
else
targ.style.display = '';
}
}
</script>
|| <a href="#" onclick="show('0', '4')">eng</a>
|| <a href="#" onclick="show('1', '4')">est</a>
|| <a href="#" onclick="show('2', '4')">rus</a>
|| <a href="#" onclick="show('3', '4')">fin</a>
|| <a href="#" onclick="show('none', '4')">Hide All</a>
<br />
<textarea rows="5" cols="40" id="0" style="display: none" name="additional[eng]"></textarea>
<textarea rows="5" cols="40" id="1" style="display: none" name="additional[est]"></textarea>
<textarea rows="5" cols="40" id="2" style="display: none" name="additional[rus]"></textarea>
<textarea rows="5" cols="40" id="3" style="display: none" name="additional[fin]"></textarea>Code: Select all
<script type="text/javascript">
function show(id, tot)
{
for (i = 0; i < tot; i++)
{
targ = document.getElementById('a'.i);
if ('a'.i != id)
targ.style.display = 'none';
else
targ.style.display = '';
}
}
</script>
|| <a href="#" onclick="show('a0', '4')">eng</a>
|| <a href="#" onclick="show('a1', '4')">est</a>
|| <a href="#" onclick="show('a2', '4')">rus</a>
|| <a href="#" onclick="show('a3', '4')">fin</a>
|| <a href="#" onclick="show('none', '4')">Hide All</a>
<textarea rows="5" cols="40" id="a0" style="display: none" name="additional[eng]"></textarea>
<textarea rows="5" cols="40" id="a1" style="display: none" name="additional[est]"></textarea>
<textarea rows="5" cols="40" id="a2" style="display: none" name="additional[rus]"></textarea>
<textarea rows="5" cols="40" id="a3" style="display: none" name="additional[fin]"></textarea>