<!DOCTYPE html>
<html>
<head>
<title>Checkbox zum de/aktivieren von anderen Elementen</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="expires" content="0">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#geb')[0].onclick = function(){
$('input[name=gebradio]').each(
function(key, radio){
radio.disabled = $('#geb').attr('checked');
if($('#geb').attr('checked')){
radio.checked = false;
}
}
);
$('#auswahl')[0].style.color = ($('#geb').attr('checked')) ? 'gray' : 'black';
}
});
</script>
<style type="text/css">
body{
font-family: verdana, georgia, arial, sans-serif;
}
.sourcecode {
border:1px solid #c0c0c0;
background-color:#f8f8f8;
margin:10px 5px;
padding:10px;
}
dl {
padding:0;
margin:0;
margin-bottom:1em
}
dt {
margin:0;
padding:0;
margin-left:120px;
font-weight:bold;
}
dd {
padding:0;
margin:0;
}
form {
width:50%;
margin:0 auto;
padding:1em 1.5em;
background:#ffe8c0;
border:4px solid #f0a080;
border-radius:15px;
-webkit-border-radius:15px;
-moz-border-radius:15px;
-khtml-border-radius:15px;
behavior:url('css/border-radius.htc'); /* Dem Internet Explodierer muss man erst einmal Benehmen beibringen, wenns um runde Ecken geht */
}
form fieldset {
margin-bottom:1em;
background:#d8f0ff;
border:4px solid #80a0f0;
border-radius:15px;
-webkit-border-radius:15px;
-moz-border-radius:15px;
-khtml-border-radius:15px;
behavior:url('css/border-radius.htc'); /* Dem Internet Explodierer muss man erst einmal Benehmen beibringen, wenns um runde Ecken geht */
}
form fieldset legend {
height:1.3em;
font-size:1.1em;
font-weight:bold;
margin:1em 0 1em 1em;
padding:0 .5em;
background:#c0e0ff;
border:4px solid #80a0f0;
border-radius:15px;
-webkit-border-radius:15px;
-moz-border-radius:15px;
-khtml-border-radius:15px;
behavior:url('css/border-radius.htc'); /* Dem Internet Explodierer muss man erst einmal Benehmen beibringen, wenns um runde Ecken geht */
}
#geb:checked+label {
color:#f00000;
}
label.textlabel {
float:left;
width:120px; /* das gleiche Maß wird auch für margin-left bei dt, input[type="radio"] und input[type="checkbox"] verwendet */
text-align:right;
padding-top:3px; /* Damit es hübscher aussieht*/
}
input[type="radio"], input[type="checkbox"] {
margin-left:120px;
}
input[type="text"], input[type="password"] {
margin-bottom: 4px;
}
input[type="submit"] {
cursor:pointer;
font-weight:bold;
background:#f0e8c0;
border:4px solid #e0c880;
border-radius:15px;
-webkit-border-radius:15px;
-moz-border-radius:15px;
-khtml-border-radius:15px;
behavior:url('css/border-radius.htc'); /* Dem Internet Explodierer muss man erst einmal Benehmen beibringen, wenns um runde Ecken geht */
}
</style>
</head>
<body>
<form id="gebdat" action="#" method="post">
<fieldset>
<legend>Anzeige von Geburtsdatum oder Alter</legend>
<dl>
<dt>Möchten Sie die Anzeige von Geburtsdatum oder Alter unterbinden?</dt>
<dd><input type="checkbox" name="geb" id="geb"><label for="geb">Alter oder Geburtsdatum nicht anzeigen</label></dd>
</dl>
<dl id="auswahl">
<dt>Wählen Sie eine Darstellungsart aus</dt>
<dd><input type="radio" name="gebradio" id="geb1" value="1"><label for="geb1">Alter</label></dd>
<dd><input type="radio" name="gebradio" id="geb2" value="2"><label for="geb2">Tag, Monat</label></dd>
<dd><input type="radio" name="gebradio" id="geb3" value="3"><label for="geb3">Tag, Monat, Jahr</label></dd>
</dl>
<dl>
<dt>Name und Anschrift</dt>
<dd><label class="textlabel" for="vorname">Vorname:</label><input type="text" name="vorname" id="vorname"></dd>
<dd><label class="textlabel" for="nachname">Nachname:</label><input type="text" name="nachname" id="nachname"></dd>
</dl>
</fieldset>
<dl>
<dt></dt>
<dd><input type="submit" name="gebdatsubmit" value="Absenden"></dd>
</dl>
</form>
<div class="sourcecode">
<h2>Quelltext dieser Webseite</h2>
<?php
require_once('Ixiter_Geshi.php');
echo IxiterGeshi_parseCode(file_get_contents(__FILE__));
/*
$src = file_get_contents(__FILE__);
$lang = 'website-ish';
$geshi = new Ixiter_Geshi($src, $lang);
$geshi->keyword_links = false;
echo $geshi->parse_code();
*
*/
?>
</div>
<?php include('./piwik.php') ?>
</body>
</html>