Results 1 to 2 of 2

Thread: Can I integrate this js calendar script with my form?

  1. #1
    Join Date
    May 2004
    Posts
    51

    Can I integrate this js calendar script with my form?

    I have an HTML form that I added a js calendar function to. The user can click the calendar icon, then click on the date that he or she wants from the calendar that pops up. The date that they select is then displayed in the date field.

    The form sends data using a php script. My question is, what do I need to do so that the date that is entered will also get sent to my email address? I'm not sure what I need to do to my php file to get the date sent along with the other fields. The name and email address already get sent to my email address, I'm just trying to get the date sent as well.

    This is my form:
    Code:
    <form name="frm" method="post" action="exe_tour2.php" onSubmit="return chk();">
      <tr>
        <td width="17%">Name:</td>
        <td width="83%"><input type="text" name="name" id="textfield"></td>
      </tr>
      <tr>
        <td>Email address:</td>
        <td><input type="text" name="email" id="textfield2"></td>
      </tr>
         <tr>
    
             <td>Preferred wedding date:</td>
             <td><script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>
             </td>
      </tr>
          <tr>
        <td>&nbsp;</td>
        <td><input type="submit" name="button" id="button" value="Book It"></td>
      </tr>
      </form>
    and this is my php code:

    Code:
    <?php
    
    	$mail_msg = $mail_msg."Contact Information\n\n";
    	$mail_msg = $mail_msg."Name: ".$_POST["name"]."\n";
    	$mail_msg = $mail_msg."Email Address: ".$_POST["email"]."\n";
    		
    
      	$email = $_POST['email'];
    	mail('email@myemail.com', 'Tour Request', $mail_msg,
    	"From: <".$email.">\n\r");
    
    
    	// Mail to user
    	$mail_user = "Auto-Acknowledgement:\n\n Thank you for contacting Bellamy Mansion.\n We are in receipt of your e-mail and will respond to your inquiry shortly. \n\n Thank you for visiting at http://bellamymansion.org/weddings/ ";
    
    	mail($email, "Bellamy Mansion: Auto-Acknowledgement", $mail_user,
    	"From: Bellamy Mansion<'weddingcenter@bellamymansion.org'>\n\r");
    
    
    header("Location: thanks.htm");
    
    ?>
    I'm not sure if I posted everything I need to or not. Don't know if the js file needs to be amended, if so, I can attach it.

    Thank you for your help!

  2. #2
    Join Date
    Apr 2009
    Posts
    47
    the js should be entering the chosen date into a field on your form, that can then be passed to you mail message

Posting Permissions

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