firstplaya
Mitglied
Kann mir wer sagen was an dem Code falsch ist das er nicht geht irgend wie haut das mit den Buttons nicht hin...
Hier der Code :
Hier der Code :
Code:
this.onEnterFrame = function() {
but1.setText("Löschen");
but2.setText("Abschicken");
delete this.onEnterFrame;
}
restrictFields();
function restrictFields() {
msg_organi.restrict = msg_forename.restrict = msg_lastname.restrict =
msg_ort.restrict = msg_event.restrict = msg_event.restrict =
msg_show.restrict = "a-zA-Z.\\-öäüÖÄÜß";
msg_tel.restrict = msg_datum.restrict = "0-9/\\- ";
msg_mail.restrict = "a-zA-Z0-9_\\-.@";
}
function checkForm() {
var error = 0;
error += (msg_organi.text.length < 3)? 2 : 0;
error += (msg_lastname.text.length < 2)? 2 : 0;
error += (msg_forename.text.length < 2)? 2 : 0;
error += (msg_tel.text.length < 4)? 4 : 0;
error += (msg_mail.text.length < 10)? 8 : 0;
error += (msg_mail.text.indexOf("@") < 3 || msg_mail.text.lastIndexOf("@") > msg_mail.text.length - 4) ? 16 : 0;
error += (msg_mail.text.indexOf(".") < 3 || msg_mail.text.lastIndexOf("@") > msg_mail.text.length - 2) ? 32 : 0;
error += (msg_datum.text.length < 6)? 2 : 0;
error += (msg_ort.text.length < 3)? 2 : 0;
error += (msg_event.text.length < 3)? 2 : 0;
error += (msg_show.text.length < 4)? 2 : 0;
error += (msg_message.text.length < 2) ? 64 : 0;
return error;
}
function sendForm() {
var error = checkForm();
if (error == 0) {
var LV = new LoadVars();
LV.msg_organi = escape(msg_organi.text);
LV.msg_lastname = escape(msg_lastname.text);
LV.msg_forename = escape(msg_forename.text);
LV.msg_tel = escape(msg_tel.text);
LV.msg_mail = escape(msg_mail.text);
LV.msg_datum = escape(msg_tel.text);
LV.msg_ort = escape(msg_tel.text);
LV.msg_event = escape(msg_tel.text);
LV.msg_show = escape(msg_tel.text);
LV.msg_message = escape(msg_message.text);
LV.sendAndLoad("mailto.php", LV, "POST");
LV.onLoad = function() {
display.text = "\n> ";
if (this.answer != undefined) {
display.text += unescape(this.answer);
} else {
display.text += "Ein unbekannter Fehler ist aufgetreten!";
}
if (this.success == "true") clearForm();
}
} else {
display.text = errorMsg(error);
}
}
function errorMsg(error) {
var estr = "";
if (error >> 6) {estr += "\n> Geben Sie eine Nachricht ein"; error -= 64;}
if (error >> 5) {estr += "\n> ungültige Domain in der eMail-Adresse"; error -= 32;}
if (error >> 4) {estr += "\n> ungültige eMail-Adresse"; error -= 16;}
if (error >> 3) {estr += "\n> Geben Sie eine eMail-Adresse ein"; error -= 8;}
if (error >> 2) {estr += "\n> Geben Sie eine Telefonnummer ein"; error -= 4;}
if (error >> 1) {estr += "\n> Füllen Sie das Formular vollständig aus Bitte"; error -= 2;}
return estr;
}
function clearForm() {
msg_organi.text = "";
msg_lastname.text = "";
msg_forename.text = "";
msg_tel.text = "";
msg_mail.text = "";
msg_datum.text = "";
msg_ort.text = "";
msg_event.text = "";
msg_show.text = "";
msg_message.text = "";
}