Aiuto per la validazione

  • Creatore Discussione Creatore Discussione Nyl
  • Data di inizio Data di inizio

Nyl

Utente Attivo
28 Apr 2008
71
0
0
sulgiappone.altervista.org
Ciao a tutti,
ho un problema con la validazione e non riesco a risolvere.

Doctype: XHTML 1.0 Transitional

Il codice è questo:
Codice:
<form name="form" action="http://alljapan.altervista.org/header.php"><input class="citazione" name="input" />
<input class="pulsante" type="button" value="Citazione" onClick="randomdisplay()"/></form>
<script type="text/javascript">
quotes = new Array();
quotes[0]="La vita umana è breve, ma io vorrei vivere sempre - Yukio Mishima";
quotes[1]="Anche chi ama prima o poi dovrà morire. Però intanto è vivo - B.Yoshimoto";
quotes[2]="Alla porta di chi ride, fortuna giunge - Proverbio Giapponese";
quotes[3]="Le emozioni non hanno simpatia per l'ordine fisso - Yukio Mishima";
quotes[4]="Chi compra il superfluo, vende il necessario - Proverbio Giapponese";
quotes[5]="I periodi finiscono, come le stagioni.Semplicemente - B.Yoshimoto";
quotes[6]="La forza di volontà attraversa anche le rocce - Proverbio Giapponese";
quotes[7]="Felicità è anche non accorgersi che in realtà si è soli - B.Yoshimoto";
quotes[8]="La forza di volontà attraversa anche le rocce - Proverbio Giapponese";
function randomdisplay(){
randomquote=quotes[Math.floor(Math.random()*quotes.length)]
document.form.input.value=randomquote
}

setTimeout("randomdisplay()",100)
</script>

e mi appare il seguente messaggio di errore

Line 32, Column 64: there is no attribute "onClick".
…s="pulsante" type="button" value="Citazione" onClick="randomdisplay()"/></form>

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

Non è che qualcuno saprebbe dirmi come risolvere per favore...
Grazie per l'attenzione
 
ciao non sono un esperto, ma prova a scrivere

onClick=randomdisplay()
inoltre dopo <scripit..> e subito prime di </script>
inserisci
<!--

-->
ciao
 
Prova a scrivere onclick tutto minuscolo e metti il codice Javascript in un file esterno .js, richiamandolo con:

<script type="text/javascript" src="file.js"></script>

Fammi sapere.
 

Discussioni simili