Results 1 to 4 of 4

Thread: Calendar script in reservations form

  1. #1
    Join Date
    Apr 2009
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Calendar script in reservations form

    I'm trying to add the calendar script in my reservation form. I found the script on http://www.dynamicdrive.com/dynamici...oncalendar.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
    Code:
    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 >
    Code:
    <?
    $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.
    Last edited by Adrenalinko; 04-25-2009 at 12:54 PM. Reason: added “Resolved” prefix

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    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

    HTML Code:
    <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

  3. #3
    Join Date
    Apr 2009
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up

    This solved my problem and made my life easier lol
    Thank you very much, I really appreciate.

  4. #4
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    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)

  5. The Following User Says Thank You to forum_amnesiac For This Useful Post:

    Adrenalinko (04-25-2009)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •