Date picker in form?

  • itsupporten
  • itsupporten's Avatar Topic Author
  • Visitor
  • Visitor

itsupporten created the topic: Date picker in form?

Hi guys

I am creating a form where I need the users to be able to pick a date in the form. Is this a functionality in the Breeze? Or do I have to make 3 dropdownmenus (DD/MM/YY)?

Brgds. Jacob Skov
#4981
  • itsupporten
  • itsupporten's Avatar Topic Author
  • Visitor
  • Visitor

itsupporten replied the topic: Re:Date picker in form?

Hmmm... found the answer myself in the community forms: Calendar. But I only need one field? When I try to drop the end date fiield I get an error popup stating the selected date. I tried to remove all entries to the end date in the submitpieces in the form, but I still get the error? What do I do?

Submit form looks like this:

// Get the date entered

$startdate = '';

foreach ($this->submitdata as $data)
switch ($data[1]) {
case 'StartDate' : $startdate = date("Y-m-d",strtotime($data[4]));
break;

default : break;
} // switch
// Pop-up the entered value to show it has been read
echo ('
<script language="JavaScript">alert ("'.$startdate.'");</script>


')

And it used to look like this:

// Get the date entered

$startdate = '';
$enddate = '';
foreach ($this->submitdata as $data)
switch ($data[1]) {
case 'StartDate' : $startdate = date("Y-m-d",strtotime($data[4]));
break;
case 'EndDate' : $enddate = date("Y-m-d",strtotime($data[4]));
break;
default : break;
} // switch
// Pop-up the entered value to show it has been read
echo ('
<script language="JavaScript">alert ("'.$startdate.' to '.$enddate.'");</script>

')
#4982
  • Posts: 9
  • Thank you received: 0

almeidaniel replied the topic: Re:Date picker in form?

Look in here:
http://www.facileforms.biz/wiki/Using_JSCalendar_in_FF
Download the attached file.
Works fine.

File Attachment:

File Name: JSCalendar.zip
File Size:2 KB
#5103
Attachments:
  • Posts: 9
  • Thank you received: 0

seahorse replied the topic: Re:Date picker in form?

You should update that link in the wiki, the original link there is broken...
#8382
  • Posts: 9
  • Thank you received: 0

seahorse replied the topic: Nice Datepicker

Hi guys, I spent most of the day to give some datepickers a try.
I just wanted to get rid of the old JSCal. First I tried JSCal2, but the guy seems to want some 80 $ to run it and anyway I didn't suceed on the fly and gave up on it.

I went out looking for something else and found this:

Unobtrusive Date-Picker Widget V4

To install, copy the contents of the .zip file to {mossite}/includes/js/

For the "before form" script:
// 
load the standard FacileForms library
$this->execPieceByName('ff_InitLib');

// include the javascript functions for dates
echo ('
  <script type="text/javascript" src="{mossite}/includes/js/date-picker-v4/js/lang/de.js"></script>
  <script type="text/javascript" src="{mossite}/includes/js/date-picker-v4/js/lang/en.js"></script>
  <script language="javascript" src="{mossite}/includes/js/date-picker-v4/js/datepicker.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" media="all" href="{mossite}/includes/js/date-picker-v4/css/datepicker.css">
');

Its pretty easy to trigger. Just add a text field and provide the class for the input. Thats it, the script does the rest and it looks amazing.

The only drawback I found so far, is the maxlength of the class input field in FacileForms itself, its set to 30. To call a calender with a lot of options, the classname could be very long and only the first 30 characters are saved. So I went about changing it here:

/administrator/components/com_facileforms/admin/element.html.php

search for this line:
<input type="text" size="30" maxlength="30" name="class2" value="<?php echo $row->class2; ?>" class="inputbox"/>

and change to:
<input type="text" size="30" maxlength="120" name="class2" value="<?php echo $row->class2; ?>" class="inputbox"/>

thats probably enough space.

Then you have to alter the corresponding field in the database, its also set to hold 30 chars. Its in the table "jos_facileforms_elements" the field name is "class2". Just set it to the same value you apllied to the maxlenghth.

Thats it, see it here:

East End Apartment

Maybe somebody could figure out howto pick the right localisation onload, from within FacileForms.

Cheers
Klaus
#8383
  • Posts: 9
  • Thank you received: 0

seahorse replied the topic: Re: Nice Datepicker

Seems like I was too happy too fast. The date shows up in the text field, but is not submitted with the form.

Anybody could figure why ?
#8384
Moderators: ForumSupporttomeperica
Time to create page: 0.038 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Special Offer! Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for only 70!

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, WordPress® plugins, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here