Quote Originariamente inviata da KillerWorm Visualizza il messaggio
Ad occhio vedo qualche errore grossolano.
Hai dichiarato le variabili Titolo e Testo mentre nei test utilizzi title e text. Non tornano i conti.
ho aggiustato in questo modo.
codice:
<head>

<script type="text/javascript">
var ck_title = /^[A-Za-z0-9!@#$%^&*()?;+.:,;_]{1,100}$/;
var ck_text =  /^[A-Za-z0-9!@#$%^&*()?;'";+.:,;_]{1,15000}$/;

function validate(form){
var title = form.title.value;
var text = form.text.value;
var errors = [];
 
if (!ck_title.test(title)) {
  errors[errors.length] = "Carattere/i non ammesso/i nel Titolo!";
 }
 if (!ck_text.test(text)) {
  errors[errors.length] = "Carattere/i non ammesso/i nel Testo!";
 }
 
 if (errors.length > 0) {

  reportErrors(errors);
  return false;
 }
  return true;
}
function reportErrors(errors){
 var msg = "Inserisci Caratteri Consentiti. \n";
 for (var i = 0; i<errors.length; i++) {
 var numError = i + 1;
  msg += "\n" + numError + ". " + errors[i];
}
 alert(msg);
}
</script>
Adesso però mi da errore nel titolo. può essere perchè il titolo è un input mentre il testo è una textarea? grazie per l'aiuto