PDA

View Full Version : js getelementbyid problem


mwijbenga
02-26-2004, 03:44 AM
<HTML>
<HEAD>
<script language="javascript">
<!--
function ChangeSearch(){
document.getElementById('auto').href = '../lib/auto/zoeken_auto.php?categorie=3';
document.getElementById('bedrijfswagen').href = '../lib/bedrijfswagen/zoeken_bedrijfswagen.php?categorie=4';
document.getElementById('camper').href = '../lib/camper/zoeken_camper.php?categorie=7';
document.getElementById('caravan').href = '../lib/caravan/zoeken_caravan.php?categorie=9';
document.getElementById('motor').href = '../lib/motor/zoeken_motor.php?categorie=5';
document.getElementById('onderdelen').href = '../lib/onderdelen/zoeken_onderdelen.php?categorie=6'
}

function ChangeOffer(){
document.getElementById('auto').href = '../lib/auto/aanbieden_auto.php?categorie=3';
document.getElementById('bedrijfswagen').href = '../lib/bedrijfswagen/aanbieden_bedrijfswagen.php?categorie=4';
document.getElementById('camper').href = '../lib/camper/aanbieden_camper.php?categorie=7';
document.getElementById('caravan').href = '../lib/caravan/aanbieden_caravan.php?categorie=9';
document.getElementById('motor').href = '../lib/motor/aanbieden_motor.php?categorie=5';
document.getElementById('onderdelen').href = '../lib/onderdelen/aanbieden_onderdelen.php?categorie=6';
}

-->
</script>
</HEAD>
<BODY>
<a href="#" OnClick="javascript:ChangeSearch();">zoeken</a>
<a href="#" OnClick="javascript:ChangeOffer();">aanbieden</a>
<br><br>
<a href="../lib/auto/zoeken_auto.php?categorie=3" id="auto">auto</a><br>
<a href="../lib/bedrijfswagen/zoeken_bedrijfswagen.php?categorie=4" id="bedrijfswagen">bedrijfswagen</a><br>
<a href="../lib/camper/zoeken_camper.php?categorie=7" id="camper">camper</a><br>
<a href="../lib/caravan/zoeken_caravan.php?categorie=9" id="caravan">aucaravanto</a><br>
<a href="../lib/motor/zoeken_motor.php?categorie=5" id="motor">motor</a><br>
</BODY>
</HTML>


the following source returns an error when i click on "zoeken" and "aanbieden".

The error is "
line 17
'document.getElementByID(..)' is empty or not an object

Willy Duitt
02-26-2004, 04:14 AM
There is no element with the ID of: onderdelen

.....Willy

mwijbenga
02-26-2004, 04:31 AM
thanks! works stupid me..

but when i try to use it in another page it doesnt work.
check it out at www.mobiel500.nl/dev/lib/top.php

when i press "zoeken" or "aanbieden" i get an instant error that the action is not supoorted by this object.

pleeeease help! thanks a mil

Willy Duitt
02-26-2004, 05:30 AM
parent.contentFrame is not an object.

Why are you targeting a frame named contentFrame when you are not using frames? }:-)

.....Willy

mwijbenga
02-26-2004, 06:14 AM
top.php is the topframe in a frameset, ive been trying a lot of stuff and it seems to be working ok now, except for some bugs..which im going to try to debug now, if it wont work ill be back :)

thanks for your help dude!

agent002
02-26-2004, 06:56 AM
As you have an other thread too, it's best that I put the link here (http://www.htmlforums.com/showthread.php?s=&postid=228256)...