hi all,
ik heb eventjes een vraagje over javascript en css..

1. Javascript:
als ik nu op de link druk, die best netjes is opgemaakt enzo, dan word het radiobuttontje niet gechecked in IE
hoe los je dat op met javascript?

2. CSS:
de twee links staan helemaal verkeerd in IE, ze staan helemaal onder elkaar met wat witte ruimte ertussen, hoe krijg ik dat goed?

ik plons de hele code hierneer zodat je het kan testen op bijv:
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_comment

<html>
<head>
<script language="Javascript">
myFunction(HetId) {
Hetid.checked
}
</script>
<style type="text/css">
        label {
            cursor: pointer;
        }

        .lijnuit {
            margin-left: 104px;
        }
		#linkmetinput ol
		{
		margin: 0px 0px 0px 0px;
		padding: 0px;
		list-style-type: none
		}

		#linkmetinput li
		{
		margin: 0px 0px 0px 0px;
		}

		#linkmetinput a
		{
		display: block;
		color: #666666;
		background-color: #F1F1F1;
		border: 1px solid #F1F1F1;
		width: 195px;
		padding: 1px 2px 1px 2px;
		text-decoration: none;
		}

		#linkmetinput a:hover
		{
		background-color: #F8F8F8;
		border: 1px solid #999999;
		color: #333333;
		}
		#linkmetinput img
		{
		border: 0px;
		}
		#linkmetinput input
		{
		margin: 0px;
		padding: 0px;
		}
</style>
</head>
<body>
<form>
	<DIV ID="linkmetinput">
		<OL>
			<LI><label for="rood"><A HREF="javascript:myFunction(document.getElementById(rood))"><input id="rood" name="kleur" type="radio" value="rood"><img src="accept.png"></A></label></LI>
			<LI><label for="groen"><A HREF="javascript:myFunction()"><input id="groen" name="kleur" type="radio" value="groen"><img src="add.png"></A></label></LI>
		</OL>
	</DIV>
</form>
</body>
</html>
iemand een ideetje?
niemand dus...
<script language="Javascript">
myFunction(HetId) {
Hetid.checked
}
</script>

De ene keer is het een hoofdletter, en de andere keer een kleine letter
Ik niet in ieder geval...
o jah, dat is natuurlijk wel een domme fout, maar met de hoofd/kleine letters goed werkt het nog steeds niet.
het werkt ook niet als ik er dit van maak:

myFunction(Hetid) {
Hetid.checked = true
}


[edit]
code tags
[/edit]
[edit]
ik denk dat we op Jan Koehoorn gaan wachten xD
[/edit]

myFunction(id) {
   document.getElementById(id).checked = true;
}
<a href="javascript:myFunction('rood')">Check</a>
sorry Jelmer,
werkt niet...
ik zal wel eventjes m'n script posten wat ik tot nu toe heb:

<html>
<head>
<script language="Javascript">
myFunction(id) {
   document.getElementById(id).checked = true;
}
</script>
<style type="text/css">
        label {
            cursor: pointer;
        }

        .lijnuit {
            margin-left: 104px;
        }
		#linkmetinput ol
		{
		margin: 0px 0px 0px 0px;
		padding: 0px;
		list-style-type: none
		}

		#linkmetinput li
		{
		margin: 0px 0px 0px 0px;
		}

		#linkmetinput a
		{
		display: block;
		color: #666666;
		background-color: #F1F1F1;
		border: 1px solid #F1F1F1;
		width: 195px;
		padding: 1px 2px 1px 2px;
		text-decoration: none;
		}

		#linkmetinput a:hover
		{
		background-color: #F8F8F8;
		border: 1px solid #999999;
		color: #333333;
		}
		#linkmetinput img
		{
		border: 0px;
		}
		#linkmetinput input
		{
		margin: 0px;
		padding: 0px;
		}
</style>
</head>
<body>
<form>
	<DIV ID="linkmetinput">
		<OL>
			<LI><label for="rood"><A HREF="javascript:myFunction('rood')"><input id="rood" name="kleur" type="radio" value="rood"><img src="accept.png"></A></label></LI>
			<LI><label for="groen"><A HREF="javascript:myFunction()"><input id="groen" name="kleur" type="radio" value="groen"><img src="add.png"></A></label></LI>
		</OL>
	</DIV>
</form>
</body>
</html>


Edit:
of ligt het gewoon eraan dat het een link is, en dat de pagina word gerefreshed, en dat er dan helemaal niks is geselecteerd?
Wat zegt Firefox over je Javascript? (Lees: Extra > Javascript-console)
aaaaaaaaaaaaaaargh!
ik schaam me dood!
ik eventjes kijken bij die Javascript-consol, en dan staat er:
undefined function -> LOL
myFunction(id) {
document.getElementById(id).checked = true;
}
moet zijn:
function myFunction(id) {
document.getElementById(id).checked = true;
}


[edit]
en nu, een nieuw topic voor vraag 2 of gewoon hierzo?

Reageren