Hallo liebe Typo3 Freunde,
Mein Problem:
Ich habe mangels TYPO3 Extension ein Auswertungsformular in JavaScript gebaut.
Auf der ersten Seite werden die zutreffenden Fragen angekreuzt. Auf der zweiten Seite wird das Formular ausgewertet. Das funktioniert lokal auch ganz gut.
Wenn ich das in TYPO3 einbaue, wird die zweite Seite nicht aufgerufen!
JavaScript...
<script type="text/javascript" src="fileadmin/templates/js/quizconfig.js">
</script>
<script type="text/javascript">
var actualchoices=new Array()
document.cookie="ready=yes"
</script>
...HTML
div class="umfragebox">
<div class="umfragetext">
<h6><strong>Frage 10:</strong><br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </h6></div>
<div class="checkbox">
<fieldset>
<p><label>
<input type="radio" value="a" name="question10" /> a. trifft nicht zu
</label> </p>
<p><label>
<input type="radio" value="b" name="question10" /> b. trifft teilweise zu
</label> </p>
<p><label>
<input type="radio" value="c" name="question10" /> c. trifft oft zu
</label> </p>
<p><label>
<input type="radio" value="d" name="question10" /> d. trifft vollkommen zu
</label> </p>
</fieldset>
</div>
</div>
</form>
<div class="umfragebox">
<form>
<input type="button" value="Reset" name="B2" onclick="document.myquiz.reset()" />
<input type="button" value="Auswerten" name="B1" onclick="gradeit()" />
</form>
</div>
#####################
// erstellt am 2009_07_28
//Anzahl der Fragen
var totalquestions=10
//Konfiguration der Lösungen
var correctchoices=new Array()
correctchoices[1]='a' //Lösung Frage 1
correctchoices[2]='a' //Lösung Frage 2 usw.
correctchoices[3]='a'
correctchoices[4]='a'
correctchoices[5]='a'
correctchoices[6]='a'
correctchoices[7]='a'
correctchoices[8]='a'
correctchoices[9]='a'
correctchoices[10]='a'
/////Ende Konfiguration//////////////////////////
function gradeit(){
var incorrect=null
for (q=1;q<=totalquestions;q++){
var thequestion=eval("document.myquiz.question"+q)
for (c=0;c<thequestion.length;c++){
if (thequestion[c].checked==true)
actualchoices[q]=thequestion[c].value
}
if (actualchoices[q]!=correctchoices[q]){ //bei einer inkorrekten Auswahl
if (incorrect==null)
incorrect=q
else
incorrect+="/"+q
}
}
if (incorrect==null)
incorrect="a/b"
document.cookie='q='+incorrect
if (document.cookie=='')
alert("Ihr Browser akzeptiert keine Cookies. Bitte aktivieren Sie JavaScript in Ihren Browsereinstellungen.")
else
window.location="../../fileadmin/templates/ergebnisse.html"
Wo liegt der Fehler!
Danke - Ich bin am verzweifeln!