Ciao a tutti!
ho un problema fastidioso ..sarà il caldo, ma non riesco a venirne a capo.

Dopo aver creato un form mail, con la tecnica ajax/php perfettamente funzionante, mi sonoa ccorto che quando nel corpo testo del messaggio faccio degli a capo schiacciando il tasto enter, il messaggio poi non viene inviato e si impianta il caricamento dell'invio mail all'infinito(senza appunto mandare poi niente).

devo per caso dichiarare che il corpo messaggio (che ho chiamato "text") accetta anche gli a capo?
come e dove? Help me please...

dovè che sbaglio? questo è il codice JS:

===============================

$(document).ready(function(){
$("#sendmail").click(function(){
var valid = '';
var isr = ' is required.';
var name = $("#name").val();
var mail = $("#mail").val();
var subject = $("#subject").val();
var text = $("#text").val();
if (name.length<1) {
valid += '
Name'+isr;
}
if (!mail.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) {
valid += '
A valid Email'+isr;
}
if (subject.length<1) {
valid += '
Subject'+isr;
}
if (text.length<1) {
valid += '
Text'+isr;
}
if (valid!='') {
$("#response").fadeIn("slow");
$("#response").html("Error:"+valid);
}
else {
var datastr ='name=' + name + '&mail=' + mail + '&subject=' + subject + '&text=' + text;
$("#response").css("display", "block");
$("#response").html("Sending message .... [img]loading_small.gif[/img]" ) ;
$("#response").fadeIn("slow");
setTimeout("send('"+datastr+"')",2000);
}
return false;
});
});
function send(datastr){
$.ajax({
type: "POST",
url: "mail.php",
data: datastr,
cache: false,
success: function(html){
$("#response").fadeIn("slow");
$("#response").html(html);
setTimeout('$("#response").fadeOut("slow")',2000);
}
});
}
================================================== ===


il file "mail.php" non credo che serva per sistemare questo problema...se serve fatemi pure sapere che lo scrivo.