Hi,
1. i tryd to enable the "build in" validation. This will work fine with all forms made by the wizzard, but not with my "old" importet forms. (my mistake?)
2. So testet the serverside validation. That works fine.
But in case of an error the reshown form has no data. All fields are blank!
My website: http://www.dj-hochzeit.net/buchungsanfrage.html
Could you please help me for 1. or 2.?
My Code:
And the Formcode
1. i tryd to enable the "build in" validation. This will work fine with all forms made by the wizzard, but not with my "old" importet forms. (my mistake?)
2. So testet the serverside validation. That works fine.
But in case of an error the reshown form has no data. All fields are blank!
My website: http://www.dj-hochzeit.net/buchungsanfrage.html
Could you please help me for 1. or 2.?
My Code:
<?php
$errors = array();
$name = JRequest::getString('nachname','', 'post');
if ( !$name ) {
$errors[] = 'Bitte geben Sie Ihre Nachnamen ein';
}
$name = JRequest::getString('email','', 'post');
if ( !$name ) {
$errors[] = 'Bitte geben Sie eine gültige Emailadresse an';
}
$name = JRequest::getString('vaort','', 'post');
if ( !$name ) {
$errors[] = 'Bitte ggf. PLZ und den Ort Ihrer Veranstaltung eintragen';
}
$name = JRequest::getString('vaanlass','', 'post');
if ( !$name ) {
$errors[] = 'Bitte den Anlass Ihrer Veranstaltung eintragen';
}
if ( count($errors) ) {
$message = "";
foreach ($errors as $error ) {
$message .= "<div class='error' >$error</div>";
}
return $message;
}
?>
And the Formcode
<table width="592" border="0" > <tr valign="top"> <td colspan="3" > <p align="center"><font face="Arial, Helvetica, sans-serif" size="3"><b><font size="4">Ja, ich interessiere mich für die <font color="#666666">Mobildiscothek</font></font><font color="#FF6633" size="4">nice</font><font size="4">!</font></b></font><font face="Arial, Helvetica, sans-serif"><b><br><br><font face="Arial, Helvetica, sans-serif"><b><font size="2">Bitte machen Sie mir ein unverbindliches Angebot für folgende Veranstaltung:<br><em>Sie können vorab <a href="http://www.mobildisco-nice.de/calendar.html">hier in der Buchungsübersicht</a> prüfen, ob der Termin noch frei ist. Sollte der Termin rot hinterlegt sein werde ich Ihre Anfrage ggf. an einen Kollegen weiterleiten.</em><br><i>(Bitte geben Sie die Daten ein und drücken Sie dann ABSENDEN.) </i></font></b></font><font size="2"></font></b></font></p>
<table border="0" cellpadding="0" cellspacing="0" width="586" height="994"><tr><td valign="top" height="991"> <table border=0 cellspacing=0 cellpadding=0 width=580> <tr> <td align=left height="23"><font color="#000000" size="1">Die mit einem </font><font color="#000000"><font color="#FF0000">*</font></font><font color="#000000" size="1"> gekennzeichneten Felder sind Pflichtfelder, ohne die wir Ihre Anfrage leider nicht korrekt bearbeiten können.</font></td> </tr> </table> <hr align=left width="580"> <table border=0 cellspacing=0 cellpadding=0 width=580> <tr> <td colspan="4" align=left height="25"><font color="#000000"><b>Termin der Veranstaltung</b></font></td> </tr> <tr> <td width="65"><font color="#000000">Datum:<font color="#FF0000">*</font></font></td> <td width="184"><font color="#000000">
<input type="Text" name="vadatum" size="25" title="Datum der Veranstaltung">
</font></td> <td width="67" font color=#FFFFFF size="-1"><font color="#000000">Startzeit:</font></td> <td width="225"><font color="#000000">
<input type="Text" name="vabeginn" size="25">
</font></td> </tr> <tr> <td width="70"> <td width="197"> </tr> <tr valign="bottom"> <td colspan="4" align=left height="25"> <hr align=left width="580"> </td> </tr> <tr> <td colspan="4" align=left height="25"><font color="#000000"><b>Kundenadresse</b></font></td> </tr> <tr> <td width="65" height="25"><font color="#000000">Vorname:</font></td> <td width="184" height="25"><font color="#000000">
<input type="text" name="vorname" size="25">
</font></td> <td width="67" height="25"><font color="#000000">Nachname:<font color="#FF0000">*</font></font></td> <td width="225" height="25"><font color="#000000">
<input type="text" name="nachname" size="25" title="Ihren Nachnamen">
</font></td> </tr> <tr> <td width="65" height="25"><font color="#000000">Straße:</font></td> <td width="184" height="25"><font color="#000000">
<input type="text" name="strasse" size="25">
</font></td> <td width="67" height="25"><font color="#000000">Firma:</font></td> <td width="225" height="25"><font color="#000000">
<input type="text" name="firma" size="25">
</font></td> </tr> <tr> <td width="65" height="25"><font color="#000000">PLZ:<font color="#FF0000">*</font></font></td> <td width="184" height="25"><font color="#000000">
<input type="text" name="plz" size="25" title="Ihre Postleitzahl">
</font></td> <td width="67" height="25"><font color="#000000">Ort:<font color="#FF0000">*</font></font></td> <td width="225" height="25"><font color="#000000">
<input type="text" name="ort" size="25">
</font></td> </tr> <tr> <td width="65" height="25"><font color="#000000">Telefon:<font color="#FF0000">*</font></font></td> <td width="184" height="25"><font color="#000000">
<input type="text" name="tel" size="25">
</font></td> <td width="67" height="25"><font color="#000000">Telefax:</font></td> <td width="225" height="25"><font color="#000000">
<input type="text" name="fax" size="25">
</font></td> </tr> <tr> <td width="65" height="25"> </td> <td width="184" height="25"> </td> <td width="67" height="25"><font color="#000000">e-mail:<font color="#FF0000">*</font></font></td> <td width="225" height="25"><font color="#000000">
<input type="text" name="email" size="25">
</font></td> </tr> <tr valign="bottom"> <td colspan="4" align=left height="25"> <hr align=left width="580"> </td> </tr> <tr> <td colspan="4" align=left height="25"> <p><font color="#000000"><b> Lokalität (Hotel, Vereinshaus etc.)</b> </font></p></td> </tr> <tr> <td width="65"><font color="#000000">Name:</font></td> <td width="184"><font color="#000000">
<input type="text" name="valokal" size="25">
</font></td> <td width="67"><font color="#000000">PLZ / Ort:<font color="#FF0000">*</font></font></td> <td width="225"><font color="#000000">
<input type="text" name="vaort" size="25" title="Ort Ihrer Veranstaltung">
</font></td> </tr> <tr valign="bottom"> <td colspan="4" align=left height="25"> <hr align=left width="580"> </td> </tr> <tr> <td colspan="4" align=left height="25"><font color="#000000"><b> Veranstaltung</b> </font></td> </tr> <tr valign="middle"> <td width="65" height="15"><font color="#000000">Anlass:<font color="#FF0000">*</font></font><font color="#000000"><font color="#FF0000"></font></font></td> <td width="184" height="15"><font color="#000000">
<input type="text" name="vaanlass" size="25" title="Anlass Ihrer Veranstaltung">
</font></td> <td width="67" height="15"><font color="#000000">Anzahl<br> der Gäste:<font color="#FF0000">*</font></font></td> <td width="225" height="15"><font color="#000000">
<input type="text" name="pax" size="10">
</font></td> </tr> <tr valign="bottom"> <td colspan="4" height="25"> <hr> </td> </tr> <tr> <td colspan="4" height="25"> <p><font color="#000000"><b>Alterstruktur Ihrer Gäste</b></font></p></td> </tr> <tr> <td colspan="4" align="left" valign="middle" height="7"><font color="#000000">
<input type="checkbox" name="check1" value="X"> <20 Jahre |
<input type="checkbox" name="check2" value="X"> 20-30 Jahre |
<input type="checkbox" name="check3" value="X"> 30-40 Jahre |
<input type="checkbox" name="check4" value="X"> 40-50 Jahre |
<input type="checkbox" name="check5" value="X"> 50-60 Jahre |
<input type="checkbox" name="check6" value="X"> 60+ </font>
</td> </tr> <tr valign="bottom"> <td colspan="4" height="25"> <hr align=left width="580"> </td> </tr> </table> <table border=0 cellspacing=0 cellpadding=0 width=580 height="48"> <tr> <td colspan="4" align=left height="25"><font color="#000000"><b>Wie sind Sie auf uns aufmerksam geworden?</b></font></td> </tr> <tr> <td align="left" colspan="4"> <font color="#000000">
<select name="aufmerksam" size="1">
<option value= „„>Auswahl:</option>
<option>Empfehlung</option>
<option>Lokalitaet</option>
<option>Live erlebt</option>
<option>Werbeflyer</option>
<option>Suchmaschine</option>
<option>sonstiges</option>
</select>
</font></td> </tr> </table> <hr align=left width="580"> <table border=0 cellspacing=0 cellpadding=0 width=580> <tr> <td colspan="4" align=left height="25"><font color="#000000"><b> Wie möchten Sie die gewünschten Informationen erhalten?</b> </font></td> </tr> <tr> <td align="left" colspan="4"> <font color="#000000" size="2">
<input type="radio" value="email" name="mailinfo">
</font> <font color="#000000" size="-1">per Email</font> <font color="#000000" size="2"><br>
<input type="radio" value="tel" name="telinfo">
</font> <font color="#000000" size="-1">Ich wünsche eine Beratung per Telefon unter </font><font size="2" color="#000000">
<input type="text" name="infotel" size="15">
<font size="1">(falls anders wie oben angegeben)</font></font></td> </tr> </table> <hr align=left width="580"> <table border=0 cellspacing=0 cellpadding=0 width=580> <tr> <td align=left><font color="#000000"><b>Kommentare/Fragen</b></font> <p><font color="#000000" size="-1">Sollten Sie Fragen, Kommentare, Anmerkungen haben,<br> können Sie uns diese im folgenden Feld mitteilen:<br> </font> </td> </tr> <tr> <td align=left> <font color="#000000"> <textarea name="kommentare" cols=60 rows=8></textarea> </font></td> </tr> </table> <font color="#000000"> </font> <table border=0 cellspacing=0 cellpadding=0 width=580> <tr> <td align=left colspan="4"> <font color="#000000">
<input type=SUBMIT value="ABSENDEN" name="SUBMIT">
<input type=reset value="RESET" name="Cancel">
</font></td> </tr> </table> <br> </td> </tr> </table>