Hallo alle,
als Newbie in Sachen Typo3 habe ich eine Frage:
Wie kann ich die Fehlermeldungen (javascript alert) zB. beim Versenden von Mails mit dem Mailformular anpassen?
Momentan erscheint bei mir eine englische Fehlermeldung wenn die Pflichtfelder nicht ausgefüllt sind.
Gruß und vielen Dank an alle Helfer
Tom
ich nehme an du benutzt die ext. mailformplus.
Die Fehlermeldungen wenn ein Feld nicht ausgefüllt wurde ect. kannst Du beliebig in dem Template selber ändern, also dein eigenes Formular benutzen:
Das ist das original das Du dann mit den Assistenten einbinden kannst unter: HTML-Template mit dem Formularfeldern
<!-- ###TEMPLATE_FORM### begin
shows formular field to be filled out
-->
<script language="JavaScript" type="text/JavaScript">
<!--
function chkFormular() {
if (document.Formular.Vorname.value == "") {
alert("Bitte geben Sie Ihren Vornamen an!");
document.Formular.Vorname.focus();
return false;
}
if (document.Formular.Nachname.value == "") {
alert("Bitte geben Sie Ihren Nachnamen an!");
document.Formular.Nachname.focus();
return false;
}
return true;
}
//-->
</script>
<form name="Formular" onSubmit="return chkFormular()" method="post" action="index.php" enctype="multipart/form-data">
<input type="hidden" name="id" value="###PID###">
<input type="hidden" name="submitted" value="1">
Anrede <input type="text" name="Anrede" value="###value_surename###">
Vorname ###error_Vorname### <input type="text" name="Vorname" value="###value_Vorname###">
Nachname ###error_Nachname### <input type="text" name="Nachname" value="###value_Nachname###">
</form>
<!-- ###TEMPLATE_FORM### end -->
<!-- ###TEMPLATE_SUBMITTED_OK### begin
OPTIONAL - will be shown if form was submitted and all required fields were filled out
-->
<b>Thank you, your request will be answered soon.</b>
<!-- ###TEMPLATE_SUBMITTED_OK### end -->
<!-- ###TEMPLATE_EMAIL_USER### begin
OPTIONAL - this will be the email text that is sent to the user (plaintext!)
-->
Hello ###surename###,
You have just filled out our FAQ-form and asked:
###question###
We will send you the answer as soon as possible,
ciao, the riddler-team
<!-- ###TEMPLATE_EMAIL_USER### end>
<!-- ###TEMPLATE_ERROR### begin
OPTIONAL ? this section holds the error texts for the input fields.
Only a primitive server side check is supported: you can specify fiels that have to be filled out. If not, this error message is shown.
-->
<!-- ###ERROR_START### begin
this is used for the global error marker ###ERROR### -->
The following errors occured:
<ul>
<!-- ###ERROR_START### end -->
<!-- ###ERROR_END### begin
this is used for the global error marker ###ERROR### -->
</ul>
<!-- ###ERROR_END### end -->
<!-- ###ERROR_FILESIZE### begin
this is used if you use the file upload functionality -->
<li>File is too large!</li>
<!-- ###ERROR_FILESIZE### end -->
<!-- ###ERROR_FILETYPE### begin
this is used if you use the file upload functionality -->
<li>File is not allowed!</li>
<!-- ###ERROR_FILETYPE### end -->
<!-- ###ERROR_titel### begin -->
<li>insert Title</li>
<!-- ###ERROR_titel### end -->
<!-- ###TEMPLATE_ERROR### end -->>
Das ist mein abgeändertes Formular:
<!-- ###TEMPLATE_FORM### begin
shows formular field to be filled out
-->
<script language="JavaScript" type="text/JavaScript">
<!--
function chkFormular() {
if (document.Formular.Vorname.value == "") {
alert("Bitte geben Sie Ihren Vornamen an!");
document.Formular.Vorname.focus();
return false;
}
if (document.Formular.Nachname.value == "") {
alert("Bitte geben Sie Ihren Nachnamen an!");
document.Formular.Nachname.focus();
return false;
}
if(document.Formular.Email.value.indexOf('@') == -1)
{
alert("Bitte geben Sie eine gültige E-Mail Adresse an!");
document.Formular.Email.focus();
return false;
}
if (document.Formular.Betreff.value == "") {
alert("Bitte füllen Sie das Betrefffeld aus!");
document.Formular.Betreff.focus();
return false;
}
return true;
}
//-->
</script>
<form name="Formular" onSubmit="return chkFormular()" method="post" action="index.php" enctype="multipart/form-data">
<input type="hidden" name="id" value="###PID###">
<input type="hidden" name="submitted" value="1">
<table border="0" cellspacing="0" cellpadding="0" class="csc-mailform" width="100%">
<tr>
<td style="background-color: #ffffff"><p class="formular_headline">Ihre Anfrage:</p></td>
<td style="background-color: #ffffff"> </td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label"> </p></td>
<td class="csc-form-fieldcell"><p class="formular_pflicht">Bitte füllen Sie die mit einem <img src="fileadmin/templates/images/star2.gif" width="10" height="10" alt="" border="0">) markierten Felder aus.</p></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label">Anrede</p></td>
<td class="csc-form-fieldcell"><input type="text" name="Anrede" value="" size="40"></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label-req">Vorname <img src="fileadmin/templates/images/star2.gif" width="10" height="10" alt="" border="0">)</p></td>
<td class="csc-form-fieldcell"><input type="text" name="Vorname" value="###value_Vorname###" size="40"> ###error_Vorname###</td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label-req">Nachname <img src="fileadmin/templates/images/star2.gif" width="10" height="10" alt="" border="0">)</p></td>
<td class="csc-form-fieldcell"><input type="text" name="Nachname" value="###value_Nachname###" size="40"> ###error_Nachname###</td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label">Firma</p></td>
<td class="csc-form-fieldcell"><input type="text" name="Firma" size="40" value=""></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label">Straße, Nr.</p></td>
<td class="csc-form-fieldcell"><input type="text" name="Strasse" size="40" value=""></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label">PLZ</p></td>
<td class="csc-form-fieldcell"><input type="text" name="PLZ" size="40" value=""></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label">Ort</p></td>
<td class="csc-form-fieldcell"><input type="text" name="Stadt" size="40" value=""></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label">Telefon</p></td>
<td class="csc-form-fieldcell"><input type="text" name="Telefon" size="40" value=""></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label">Telefax</p></td>
<td class="csc-form-fieldcell"><input type="text" name="Telefax" size="40" value=""></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label">Land</p></td>
<td class="csc-form-fieldcell"><input type="text" name="Land" size="40" value=""></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label-req">E-Mail <img src="fileadmin/templates/images/star2.gif" width="10" height="10" alt="" border="0">)</p></td>
<td class="csc-form-fieldcell"><input type="text" name="Email" value="###value_Email###" size="40"> ###error_Email###</td>
</tr>
<tr>
<td class="csc-form-labelcell" valign="top"><p class="csc-form-label-req">Betreff <img src="fileadmin/templates/images/star2.gif" width="10" height="10" alt="" border="0">)</p></td>
<td class="csc-form-fieldcell"><textarea name="Betreff" cols="30" rows="4" wrap="off" style="width: 225px"></textarea></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label"></p></td>
<td><input type="submit" class="abschicken" value="abschicken" style="background-image: url(fileadmin/templates/images/button.gif); background-repeat: no-repeat;"></td>
</tr>
<tr>
<td class="csc-form-labelcell"><p class="csc-form-label"> </p></td>
<td class="csc-form-fieldcell"> </td>
</tr>
</table>
</form>
<!-- ###TEMPLATE_FORM### end -->
<!-- ###TEMPLATE_SUBMITTED_OK### begin
OPTIONAL - will be shown if form was submitted and all required fields were filled out
-->
<b>Vielen Dank für Ihre Anfrage.</b>
<!-- ###TEMPLATE_SUBMITTED_OK### end -->
<!-- ###TEMPLATE_EMAIL_USER### begin
OPTIONAL - this will be the email text that is sent to the user (plaintext!)
-->
Hello ###surename###,
You have just filled out our FAQ-form and asked:
###question###
We will send you the answer as soon as possible,
ciao, the riddler-team
<!-- ###TEMPLATE_EMAIL_USER### end>
<!-- ###TEMPLATE_ERROR### begin
OPTIONAL ? this section holds the error texts for the input fields.
Only a primitive server side check is supported: you can specify fiels that have to be filled out. If not, this error message is shown.
-->
<!-- ###ERROR_START### begin
this is used for the global error marker ###ERROR### -->
The following errors occured:
<ul>
<!-- ###ERROR_START### end -->
<!-- ###ERROR_END### begin
this is used for the global error marker ###ERROR### -->
</ul>
<!-- ###ERROR_END### end -->
<!-- ###ERROR_FILESIZE### begin
this is used if you use the file upload functionality -->
<li>File is too large!</li>
<!-- ###ERROR_FILESIZE### end -->
<!-- ###ERROR_FILETYPE### begin
this is used if you use the file upload functionality -->
<li>File is not allowed!</li>
<!-- ###ERROR_FILETYPE### end -->
<!-- ###ERROR_titel### begin -->
<li>insert Title</li>
<!-- ###ERROR_titel### end -->
<!-- ###TEMPLATE_ERROR### end -->
Ich hatte mir das mal von wem kopiert, wenn ich wüsste wo ich des her hatte !
viele Grüße
sandra