Forums

Date form date to in Chronoforms 3.2

Trea 09 Dec, 2010
Hi Everyone here at the Chronoforms forums,

You've probably seen this question lot's of times but I cannot find a solution to this problem.
I have a reservation From and it needs a from and to date, but the to date cannot be before the from date.

I have found this code on the forums but it doesn't show a datepicker, am I missing a Javascript library?

Anyways I have this in the form code:

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Arrival</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="date_1" name="date_1" type="text" />
 
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Departure</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="date_2" name="date_2" type="text" />
 
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_button">
    <input value="Submit" name="button_2" type="submit" />
  </div>
  <div class="cfclear"> </div>
</div>


And i have this at the form Javascript code:

window.addEvent('domready', function() {
  new Calendar({ date_1: 'd/m/Y', date_2: 'd/m/Y' },
    {
      direction: 1,
      pad: 2,
      classes: ['dashboard']
  });
});

It shows two fields but no datepicker whatsoever. Anyone have a solution?

Thanks alot!
GreyHead 09 Dec, 2010
Hi Trea,

My guess is that the Calendar JavaScript is not being loaded. Please check that "Load Chronoforms CSS/JS Files?" is set to 'Yes' in the form General tab.

If this doesn't fix it please post a link to the form so we can take a quick look.

Bob
Trea 09 Dec, 2010
Hi Bob,

I feel so stupid, that was the problem. Thanks for the very quick reply!
The css probably has to be changed in the com_chronocontact am I right?


O on a side note, I've got multiple forms with a dynamic to, at the first form it works at the second form I get a mail server email address, any suggestions on that?

Thanks again!
GreyHead 09 Dec, 2010
Hi Trea,

Where does the email address come from for the second step? If it's carried over from the first step you may need to put it into a hidden input to make it available.
<input type='hidden' name='email' id='email' value='<?php echo $posted['email']; ?>' />

Bob
Trea 09 Dec, 2010
The email comes from the form itself

<tr>
    <td>E-mail adres*</td>
    <td><input type="text" name="mail" id="email" class="form_text" style="width:148px;"  /></td>
  </tr>


And here is what I got in the setup emails
GreyHead 09 Dec, 2010
Hi Trea,

I think that should be OK - but there can be problems with Dynamic From Emails . . .

I strongly recommend that you do *not* use the Dynamic From Email element in your Email Setups. Using this often results in your emails being marked as spam and dropped into a spam filter. Instead use the static From Email with an address that matches the site domain name and use Dynamic ReplyTo Email for the user email. The result is the same but with a much better chance of good delivery.

Bob
This topic is locked and no more replies can be posted.