Hallo Leute!
Dieses Script funktioniert mit Gecko Browsern einwandfrei jedoch mit dem InternetExplorer nicht! doch warum bitte um hilfe
danke andi!
functions.js
Dieses Script funktioniert mit Gecko Browsern einwandfrei jedoch mit dem InternetExplorer nicht! doch warum bitte um hilfe
danke andi!
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Presse</title>
<style type="text/css">
.style1 {
margin-left: 11px;
}
.style2 {
margin-left: 29px;
}
.style3 {
margin-left: 15px;
}
.style4 {
margin-left: 52px;
}
.style5 {
margin-left: 32px;
}
</style>
<script type="text/javascript" src="laufdata.js"></script>
<link rel="stylesheet" title="CSS" type="text/css" href="../styles/style1.css" media="screen" />
<script type="text/javascript" src="functions.js">
</script>
<script type="text/javascript">
window.onload = function() {
}
</script>
</head>
<body>
<!-- Begin Container -->
<div id="container">
<!-- Begin Masthead -->
<div id="masthead">
<img src="../images/logo.gif" alt="Ihr Firmenlogo" height="66" width="150" /><p>
Büro (000) 000-0000<br />
Fax (000) 000-0000<br />
gebührenfrei (000) 000-0000</p>
</div>
<!-- End Masthead -->
<!-- Begin Navigation -->
<div id="navigation">
<ul>
<li><a href="../default.htm">Privat</a></li>
<li><a href="../about/about.htm">Über</a></li>
<li><a href="../news/news.htm">Nachrichten</a></li>
<li><a href="../products/products.htm">Produkte</a></li>
<li><a href="../services/services.htm">Dienste</a></li>
<li><a href="../calendar/calendar.htm">Kalender</a></li>
<li><a href="../contact/contact.htm">Kontakt</a></li>
</ul>
</div>
<!-- End Navigation -->
<!-- Begin Page Content -->
<div id="page_content">
<!-- Begin Left Column -->
<div id="column_l">
<h2>Presse</h2>
<p>
</p>
<form method="post" name="data" action="mailto:neuhauser.andreas@aon.at">
<fieldset id="firstfieldset">
<legend>Personendaten</legend>
<label id="nachname"><strong>Nachname:</strong></label>
<input name="nachnametext" onmouseover="window.status='Bitte geben Sie hier Ihren Nachnamen ein!';return true;" onmouseout="window.status='';return true;" type="text" style="height: 14px; width: 142px" />
<label id="vorname"><strong><br />
<br />
Vorname:</strong></label>
<input name="vornametext" onmouseover="window.status='Bitte geben Sie hier Ihren Vornamen ein!';return true;" onmouseout="window.status='';return true;" type="text" style="height: 14px; width: 142px" class="style1" />
<label id="geb"><strong><br />
<br />
Geburtsdatum:</strong></label>
<input name="gebtext" onmouseover="window.status='Bitte geben Sie hier Ihr Geburtsdatum ein!';return true;" onmouseout="window.status='';return true;" type="text" style="height: 14px; width: 142px" class="style1" />
<label id="street"><strong><br />
<br />
Straße:</strong></label>
<input name="streettext" onmouseover="window.status='Bitte geben Sie hier Ihre Anschrift ein!';return true;" onmouseout="window.status='';return true;" type="text" style="height: 14px; width: 142px" class="style2" />
<label id="plz"><strong><br />
<br />
PLZ:</strong></label>
<input name="plztext" onmouseover="window.status='Bitte geben Sie hier Ihre Postleitzahl ein!';return true;" onmouseout="window.status='';return true;" type="text" style="height: 14px; width: 88px" class="style4" />
<label id="ort"><strong><br />
<br />
Wohnort:</strong></label>
<input name="orttext" onmouseover="window.status='Bitte geben Sie hier Ihren Wohnort ein!';return true;" onmouseout="window.status='';return true;" type="text" style="height: 14px; width: 142px" class="style3" />
<label id="email"><strong><br />
<br />
E-Mail:</strong></label>
<input name="emailtext" onmouseover="window.status='Bitte geben Sie hier Ihre E-Mail Adresse ein!';return true;" onmouseout="window.status='';return true;" type="text" style="height: 14px; width: 142px" class="style5" /><br />
</fieldset>
<br />
<fieldset id="secondfieldset">
<legend>Sportunion</legend>
<label id="sportunion"><strong>
Sind Sie Mitglied der Sportunion?</strong></label>
<select name="sportu" style="width: 59px; margin-left: 12px;">
<option value="Nein">Nein</option>
<option value="Ja">Ja</option>
</select>
<br />
<br />
<label id="chip"><strong>
Besitzen Sie einen Chip?</strong></label>
<select name="chipauswahl" onchange="extendChipInput();" style="width: 59px; margin-left: 72px;">
<option value="Nein">Nein</option>
<option value="Ja">Ja</option>
</select>
<br />
</fieldset>
<br id="br1" />
<input name="proof" type="button" onclick="pruefen();" value="Weiter zur Anmeldung" id="proof" />
<br id="br2" />
<br id="br3" />
</form>
<p>
</p>
</div>
<!-- End Left Column -->
<!-- End Right Column --->
<div id="column_r">
<h4>Ressourcenübersicht</h4>
<ul>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
</ul>
</div>
<!-- End Right Column --></div>
<!-- End Page Content -->
<!-- Begin Footer -->
<div id="footer">
<p><a href="../default.htm">Privat</a> | <a href="../about/about.htm">Über</a>
| <a href="../calendar/calendar.htm">Kalender</a> |
<a href="../contact/contact.htm">Kontakt</a> |
<a href="../employees/employees.htm">Mitarbeiter</a> |
<a href="../employment/employment.htm">Beschäftigung</a> |
<a href="../faq/faq.htm">FAQ</a> |
<a href="../information_links/information_links.htm">Informationshyperlinks</a>
| <a href="../news/news.htm">Nachrichten</a> |
<a href="../photo_gallery/photo_gallery.htm">Fotosammlung</a> |
<a href="press.htm">Presse</a> | <a href="../products/products.htm">Produkte</a>
| <a href="../promotions/promotions.htm">Promotion</a> |
<a href="../services/services.htm">Dienste</a> |
<a href="../site_map/site_map.htm">Sitemap</a></p>
<p>Copyright © 0000 Firmenname. Alle Rechte vorbehalten.</p>
</div>
<!-- End Footer --></div>
<!-- End Container -->
</body>
</html>
functions.js
HTML:
var f=document.forms[0];
function isAPLZ(n) {
var s = "" + n;
var ziffern = "0123456789";
if (s.charAt(0) == "-") {
s = s.substring(1, s.length);
}
if (s=="0") {
return true;
}
if (s.charAt(0) == "0") {
return false;
}
for (var i=0; i<s.length; i++) {
if (ziffern.indexOf(s.charAt(i)) == -1) {
return false;
}
}
return true;
}
function isValidEmail(mail) {
var klammeraffe = mail.indexOf("@");
if (klammeraffe < 1) {
return false;
} else {
var punkt = mail.substring(klammeraffe).indexOf(".");
if (punkt < 2) {
return false;
} else {
return true;
}
}
}
function extendChipInput() {
var f = document.forms[0];
if (f.chipauswahl.selectedIndex==1)
{
var fieldset = document.getElementById("secondfieldset");
var br = document.createElement("br");
br.setAttribute("id","after");
fieldset.appendChild(br);
var text = document.createElement("label");
text.setAttribute("id","chipnr");
var strong = document.createElement("strong");
strong.appendChild(document.createTextNode("Chip-Nummer:"));
text.appendChild(strong);
fieldset.appendChild(text);
var input = document.createElement("input");
input.style.setProperty("margin-left","57px",null);
input.setAttribute("name","chipnrcontent");
input.setAttribute("id","chipnrcontent");
input.setAttribute("onmouseover","window.status='Bitte geben Sie hier Ihren Wohnort ein!';return true;");
input.setAttribute("onmouseout","window.status='';return true");
fieldset.appendChild(input);
}
else if(f.chipauswahl.selectedIndex==0)
{
var dellabel = document.getElementById("chipnr");
if(dellabel) {
dellabel.parentNode.removeChild(dellabel);
}
var delinput = document.getElementById("chipnrcontent");
if(delinput) {
delinput.parentNode.removeChild(delinput);
}
var delbr = document.getElementById("after");
if(delbr) {
delbr.parentNode.removeChild(delbr);
}
}
}
function showLaufDetails() {
var f = document.forms[0];
var fieldset = document.getElementById("thirdfieldset");
if(fieldset) {
var index = f.laufauswahlcontent.selectedIndex;
var ort = document.getElementById("ort");
if (!ort) {
var label = document.createElement("label");
label.setAttribute("id","ort");
var strong = document.createElement("strong");
strong.appendChild(document.createTextNode("Austragungsort: "+lauf.data[index]["Ort"]));
label.appendChild(strong);
fieldset.appendChild(document.createElement("br"));
fieldset.appendChild(document.createElement("br"));
fieldset.appendChild(label);
}
else
{
ort.firstChild.firstChild.nodeValue="Austragungsort: "+lauf.data[index]["Ort"];
}
var costs = document.getElementById("costs");
if (!costs) {
var label = document.createElement("label");
label.setAttribute("id","costs");
var strong = document.createElement("strong");
strong.appendChild(document.createTextNode("Kosten: "+lauf.data[index]["Kosten"]+" €"));
label.appendChild(strong);
fieldset.appendChild(document.createElement("br"));
fieldset.appendChild(document.createElement("br"));
fieldset.appendChild(label);
}
else
{
costs.firstChild.firstChild.nodeValue="Kosten: "+lauf.data[index]["Kosten"]+" €";
}
var description = document.getElementById("description");
if (!description) {
var label = document.createElement("label");
label.setAttribute("id","description");
var strong = document.createElement("strong");
strong.appendChild(document.createTextNode("Bemerkung: "+lauf.data[index]["Bemerkung"]));
label.appendChild(strong);
fieldset.appendChild(document.createElement("br"));
fieldset.appendChild(document.createElement("br"));
fieldset.appendChild(label);
}
else
{
description.firstChild.firstChild.nodeValue="Bemerkung: "+lauf.data[index]["Bemerkung"];
}
var distance = document.getElementById("labeldistance");
if (!distance) {
var label = document.createElement("label");
label.setAttribute("id","labeldistance");
var strong = document.createElement("strong");
strong.appendChild(document.createTextNode("Distanz: "));
label.appendChild(strong);
fieldset.appendChild(document.createElement("br"));
fieldset.appendChild(document.createElement("br"));
fieldset.appendChild(label);
}
distance = document.getElementById("selectdistance");
if (distance)
fieldset.removeChild(distance);
distance = document.getElementById("selectdistance");
if(!distance) {
var auswahl = document.createElement("select");
auswahl.setAttribute("name","distance");
auswahl.setAttribute("id","selectdistance");
for (var i=0;i<lauf.data[index]["Distanz"].length;i++)
{
var option = document.createElement("option");
option.setAttribute("value",lauf.data[index]["Distanz"][i]);
option.appendChild(document.createTextNode(lauf.data[index]["Distanz"][i]));
auswahl.appendChild(option);
}
var button = document.getElementById("insert");
if (button ) {
fieldset.insertBefore(auswahl,button);
}
else {
fieldset.appendChild(auswahl);
}
}
input = document.getElementById("submitData");
if (!input) {
var input = document.createElement("input");
input.setAttribute("id","submitData");
input.setAttribute("type","submit");
input.setAttribute("name","submitButton");
var br = document.createElement("br");
br.setAttribute("id","insert");
fieldset.appendChild(br);
fieldset.appendChild(document.createElement("br"));
fieldset.appendChild(input);
}
}
}
function extendSPCMenue() {
var f = document.forms[0];
var anzahl = document.getElementsByTagName("fieldset").length;
if (anzahl < 3) {
var field = document.createElement("fieldset");
field.setAttribute("id","thirdfieldset");
var leg = document.createElement("legend");
leg.appendChild(document.createTextNode("Anmeldung - Lauf"));
field.appendChild(leg);
f.appendChild(field);
var label = document.createElement("label");
label.setAttribute("id","laufauswahl");
var strong = document.createElement("strong");
strong.appendChild(document.createTextNode("Derzeitige Läufe:"));
label.appendChild(strong);
field.appendChild(label);
var sel = document.createElement("select");
sel.setAttribute("name","laufauswahlcontent");
sel.setAttribute("onchange","showLaufDetails();");
sel.style.setProperty("margin-left","11px",null);
for (var i in lauf.data)
{
var option = document.createElement("option");
option.setAttribute("value",lauf.data[i]["Bezeichnung"]);
option.appendChild(document.createTextNode(lauf.data[i]["Bezeichnung"]));
sel.appendChild(option);
}
field.appendChild(sel);
}
}
function pruefen() {
var f = document.forms[0];
/*while (f.nachnametext.value == "") {
var nachname = prompt("Bitte geben Sie Ihren Nachnamen ein!");
if (nachname) {
f.nachnametext.value = nachname;
}
}
while (f.vornametext.value == "") {
var vorname = prompt("Bitte geben Sie Ihren Vornamen ein!");
if (vorname!="") {
f.vornametext.value = vorname;
}
}
while (f.gebtext.value == "") {
var geb = prompt("Bitte geben Sie Ihr Geburtsdatum ein!");
if (geb) {
f.gebtext.value = geb;
}
}
while (f.streettext.value == "") {
var street = prompt("Bitte geben Sie Ihre Straße ein!");
if (street) {
f.streettext.value = street;
}
}
while (f.plztext.value == "") {
var plz = prompt("Bitte geben Sie Ihre Postleitzahl ein!");
if (plz && plz.length==4 && isAPLZ(plz)) {
f.plztext.value = plz;
}
}
while (f.orttext.value == "") {
var ort = prompt("Bitte geben Sie Ihren Wohnort ein!");
if (ort) {
f.orttext.value = ort;
}
}
while (f.emailtext.value == "") {
var email = prompt("Bitte geben Sie Ihre gültige E-Mail-Adresse ein!");
if (email) {
if(isValidEmail(email)) {
f.emailtext.value = email;
}
}
}
if (f.chipauswahl.selectedIndex==1) {
while (f.chipauswahl.value == "") {
var email = prompt("Bitte geben Sie Ihre gültige E-Mail-Adresse ein!");
if (email) {
if(isValidEmail(email && email.length==7)) {
f.emailtext.value = email;
}
}
}
}*/
var br = document.getElementById("br2");
if (br) {
br.parentNode.removeChild(br);
}
br = document.getElementById("br3");
if (br) {
br.parentNode.removeChild(br);
}
var button = document.getElementById("proof");
button.parentNode.removeChild(button);
extendSPCMenue();
return true;
}