Log in

View Full Version : Resolved Calendar script in reservations form



Adrenalinko
04-22-2009, 11:46 AM
I'm trying to add the calendar script in my reservation form. I found the script on http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm and i figured out the way how to place it inside the form.
The problem is that when you fill in the date in the form and submit it I dont receive the dates.
This is the code i used

From date:</div></td>
<td class="style3">&nbsp;</td>
<td class="style2"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="textfield9">
<script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>


</font></td>
</tr>
<tr>
<td width="40%" class="style3"><div align="right"><span class="style22">To date:</span></div></td>
<td class="style3">&nbsp;</td>
<td class="style2"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="textfield10">
<script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>
dd/mm/gggg </font></td>

This is the other php file >


<?
$za=1;

$textfield = $HTTP_POST_VARS ['textfield'] ;
$textfield1 = $HTTP_POST_VARS ['textfield1'] ;
$textfield2 = $HTTP_POST_VARS ['textfield2'] ;
$textfield3 = $HTTP_POST_VARS ['textfield3'] ;
$textfield4 = $HTTP_POST_VARS ['textfield4'] ;
$textfield5 = $HTTP_POST_VARS ['textfield5'] ;
$textfield6 = $HTTP_POST_VARS ['textfield6'] ;
$textfield7 = $HTTP_POST_VARS ['textfield7'] ;
$textfield8 = $HTTP_POST_VARS ['menu1'] ;
$textfield9 = $HTTP_POST_VARS ['textfield9'] ;
$textfield10 = $HTTP_POST_VARS ['textfield10'] ;
$textarea = $HTTP_POST_VARS ['textarea'] ;
$menu1 = $HTTP_POST_VARS ['menu1'] ;


if ($za==1)
{
$message = "<b>REZERVACIJA</b><br>";

$message = $message . "<br>Ime i prezime : " . $textfield;
$message = $message . "<br>E-mail : " . $textfield1;
$message = $message . "<br>Kontakt Tel : " . $textfield2;
$message = $message . "<br>Adresa : " . $textfield3;
$message = $message . "<br>Grad : " . $textfield4;
$message = $message . "<br>Drzava : " . $textfield5;
$message = $message . "<br>Mjesto preuzimanja automobila : " . $textfield6;
$message = $message . "<br>Mjesto vracanja automobila : " . $textfield7;
$message = $message . "<br>Automobil : " . $menu1;
$message = $message . "<br>From date : " . $textfield9;
$message = $message . "<br>To date : " . $textfield10;
$message = $message . "<br>Poruka : " . $textarea;
echo $message;

$mail->From = $textfield1; // od koga je mail. ovo polje da bi samo na reply odogovrio
$mail->FromName = $textfield;
$mail->Subject = "Rezervacija sa sajta";
$mail->Body = $message;
$mail->WordWrap = 50;

if (mail("lekic100@gmail.com.com", "REZERVACIJA", $message)) echo 'PODACI USPJESNO POSLATI <br />
<a href="http://www.adutrentacar.com/rezervisi.php"><img src="/images/nazad.jpg" width="114" height="40" border="0" /></a>';
}
?>


Does anyone knows how i can rezolve this?
Thank You.

forum_amnesiac
04-22-2009, 12:15 PM
I believe that you have misunderstood the function.

The variable takes it name from that entered in the first part of the function string.

Here is a slight modification of your code that returns the value entered in the first date and the second date. You should be able to pass these variable names and values into your PHP


<form>
<table>
<tr>

<td>From date:</td>
<td class="style3">&nbsp;</td>
<td class="style2"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text"><script>DateInput('testdate1', true, 'DD-MON-YYYY')</script>


</font></td>
</tr>
<tr>
<td width="40%" class="style3">To date:</td>
<td class="style3">&nbsp;</td>
<td class="style2"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text"><script>DateInput('testdate2', true, 'DD-MON-YYYY')</script>
dd/mm/gggg </font></td>
</tr>

<tr>
<td><input type="button" onClick="alert(this.form.testdate1.value)" value="Show date1 value passed"></td>
</tr>
<tr>
<td><input type="button" onClick="alert(this.form.testdate2.value)" value="Show date2 value passed"></td>
</tr>

</table>
</form>

I am using testdate1 as the "from" date and testdate2 as the "to" date

Adrenalinko
04-23-2009, 09:41 AM
This solved my problem and made my life easier lol
Thank you very much, I really appreciate.

forum_amnesiac
04-23-2009, 10:35 AM
Pleased to help

You can go to your first post in this thread, click Edit then click Go Advanced and add the Resolved prefix to the thread title.

This will let other users know the problem has been solved.

(Resolved text above, credit to Snookerman)