08.07.2014, 08:54
Guten Morgen,
könnte mir bitte jemand erklären wie ich per Formular eine Hintergrundfarbe setze, welche auf jeder Seite sichtbar ist. Das Formular habe ich schon:
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, [Link: Registrierung erforderlich]">
<title></title>
<SCRIPT LANGUAGE = "JavaScript">
function setColor () {
var choice;
choice = document.colorForm.color.selectedIndex;
switch(choice) {
case 0: document.bgColor = "FF0000"; break;
case 1: document.bgColor = "00FF00"; break;
case 2: document.bgColor = "0000FF"; break;
case 3: document.bgColor = "FFFFFF"; break;
case 4: document.bgColor = "FFFF00"; break;
case 5: document.bgColor = "FF00FF"; break;
}
}
</SCRIPT>
</head>
<body>
<H1> Bitte eine Hintergrundfarbe auswählen: </H1>
<FORM NAME="colorForm">
<SELECT NAME="color" onChange=setColor()>
<OPTION VALUE="red">rot</option>
<OPTION VALUE="green">grün</option>
<OPTION VALUE="blue">blau</option>
<OPTION VALUE="white">weiß</option>
<OPTION VALUE="yellow">gelb</option>
<OPTION VALUE="purple">lila</option>
</SELECT>
Aber ich weiss nicht, wie ich diese als Cokkie speichere und auf einer anderen Seite auslese, um Hilfe wäre ich sehr dankbar.
Mfg,
Sebastian.
könnte mir bitte jemand erklären wie ich per Formular eine Hintergrundfarbe setze, welche auf jeder Seite sichtbar ist. Das Formular habe ich schon:
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, [Link: Registrierung erforderlich]">
<title></title>
<SCRIPT LANGUAGE = "JavaScript">
function setColor () {
var choice;
choice = document.colorForm.color.selectedIndex;
switch(choice) {
case 0: document.bgColor = "FF0000"; break;
case 1: document.bgColor = "00FF00"; break;
case 2: document.bgColor = "0000FF"; break;
case 3: document.bgColor = "FFFFFF"; break;
case 4: document.bgColor = "FFFF00"; break;
case 5: document.bgColor = "FF00FF"; break;
}
}
</SCRIPT>
</head>
<body>
<H1> Bitte eine Hintergrundfarbe auswählen: </H1>
<FORM NAME="colorForm">
<SELECT NAME="color" onChange=setColor()>
<OPTION VALUE="red">rot</option>
<OPTION VALUE="green">grün</option>
<OPTION VALUE="blue">blau</option>
<OPTION VALUE="white">weiß</option>
<OPTION VALUE="yellow">gelb</option>
<OPTION VALUE="purple">lila</option>
</SELECT>
Aber ich weiss nicht, wie ich diese als Cokkie speichere und auf einer anderen Seite auslese, um Hilfe wäre ich sehr dankbar.
Mfg,
Sebastian.