Welcome, Guest
  • Page:
  • 1
  • 2

TOPIC: Date picker in form?

Date picker in form? 3 years, 1 month ago #4981

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
  • itsupporten

Re:Date picker in form? 3 years, 1 month ago #4982

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>

')
  • itsupporten

Re:Date picker in form? 3 years, 1 month ago #5103

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: 2414

Re:Date picker in form? 2 years, 8 months ago #8382

You should update that link in the wiki, the original link there is broken...
  • seahorse
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Karma: 0

Nice Datepicker 2 years, 8 months ago #8383

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
  • seahorse
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Karma: 0

Re: Nice Datepicker 2 years, 8 months ago #8384

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 ?
  • seahorse
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Karma: 0
  • Page:
  • 1
  • 2
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.66 seconds

Facebook Discount - 40% Off!

Fans of our Facebook page here are entitled to get a 1-year-subscription for the price of a 6-months!

Steps to take:

  • Become a fan on Facebook (Like) here
  • Purchase a 6-months-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of your like and we'll upgrade to the 1-year-subscription

Joomla!® Forms Discount - 40% Off!

Already purchased a forms extension from a different vendor but your requirements changed and now you need a forms extension that is capable of more than just the standards? We help you to keep the costs for a change under control: Get a 40% discount on our professional membership plan! -- meaning timely unlimited access to all current and future commercial extensions, breezingforms themes & apps and Joomla!® templates at crosstec.de, including 1 year of support -- without any website limitations -- Just prove that you previously purchased another forms extension for Joomla!® from a different vendor and you are qualified.

Steps to take:

  • Purchase a 1-year-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of the purchase for the other form vendor and we'll upgrade to the professional-subscription

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany

Imprint