AnfrageBut I get an error message of the 2nd php variable.so I exchanged:value="row->dates; ?>"with value="Your Date"Now the Form Displays correctly, but I don`t see the calendar, neither is it workingMario"> Using the Joomla Calendar in a form - Forums

Forums

Using the Joomla Calendar in a form

mariokrupik 28 Jul, 2007
Hi,

I am trying to get the joomla calendar to work inside a form of chronoforms within joomla1.5

I am using this html code:
<link href="style.css" rel="stylesheet" type="text/css">

<? JHTML::_('behavior.calendar'); ?>


<div id="form">
<table width="610px" class="table_form" cellspacing="0">
<tr>
  <td class="td_dark" colspan="2"> Anreisetermin:
</td>
</tr>
  <td class="text_links"> Anreisedatum:
</td>
    <td class="text_rechts">
<input class="inputbox" type="text" name="dates" id="dates" size="15" maxlength="10" value="<? php echo $this->row->dates; ?>" />
 <a href="#" onclick="return showCalendar('dates', 'dd-m-y');"><img class="calendar" src="images/blank.png" alt="calendar" /></a>

      Anfrage<br/></td>
</tr>
</table>
</div>


But I get an error message of the 2nd php variable.
so I exchanged:
value="<? php echo $this->row->dates; ?>"
with value="Your Date"

Now the Form Displays correctly, but I don`t see the calendar, neither is it working

Mario
Max_admin 28 Jul, 2007
Hi Mario,

If its Joomla 1.0 then I would be able to help, but with joomla 1.5 I can't help you at least for now, Please let me know if you need the joomla 1.0 code.

Cheers

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
mariokrupik 28 Jul, 2007
If you can post me the code for joomla 1.0, I`m sure to get a whole step further.

thanks,
Mario
Max_admin 28 Jul, 2007
Mario,

You will need to add these lines of code :


<?php
mosCommonHTML::loadCalendar();
?>
<link rel="stylesheet" type="text/css" media="all" href="includes/js/calendar/calendar-mos.css" title="green" />
		<script type="text/javascript" src="includes/js/calendar/calendar.js"></script>
		<script type="text/javascript" src="includes/js/calendar/lang/calendar-en.js"></script>

<input class="inputbox" type="text" id="start_date" name="start_date" value="<?php echo $row->start_date; ?>" size="11" maxlength="11" />
            <input type="reset" class="button" value="..." onclick="return showCalendar('start_date', 'mm-dd-y');" />

Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
mariokrupik 30 Jul, 2007
HI,

got it working now.

<?php JHTML::_('behavior.calendar'); ?>
<link rel="stylesheet" href="templates/forms/anfrage.css" type="text/css">
<script type="text/javascript" src="includes/js/joomla.javascript.js"></script>

<input class="inputbox" type="text" name="anreise" id="anreise" size="25" maxlength="10" value="" />
 <a href="#" onclick="return showCalendar('anreise', 'dd-mm-y');"><img class="calendar" src="images/blank.png" alt="calendar" /></a>



too bad, it`s just not working in IE6.
Must be a problem with the Calendar itself, as the calendar is not working in the joomla backend either with ie6.

thanks again,
Mario
texttoscreen 08 May, 2008
Hi Guys

I'm using to use the Code in Post #1492, but I can't seem to get it to work with my Joomla 1.14 Version Using ChronosForm.

Please help with a Step by Step instructions
Raoul
GreyHead 09 May, 2008
Hi texttoscreen,

Please check this thread the answers are there or are linked to from there IIRC.

Bob
karamvri2008 17 Jun, 2009
This is not working for me.I get:-
showCalendar is not defined.

Could any one please explain y this is happening.
Here is my test code:-
<?php JHTML::_('behavior.calendar'); ?>
<script type="text/javascript" src="includes/js/calendar/calendar.js"></script>
      <script type="text/javascript" src="includes/js/calendar/lang/calendar-en.js"></script>

<input type="text" name="DateOfBirth" id="DateOfBirth" value="" />
<img class="calendar" src="templates/system/images/calendar.png" alt="calendar" onclick="return showCalendar('DateOfBirth', '%y-%m-%d');" /> 

<input type="submit">
GreyHead 19 Jun, 2009
Hi karamvri2008,

On my Joomla 1.5.11 setup the file includes/js/calendar/calendar.js does not exist. I'm not sure that you need these lines as well as the JHTML::_('behavior.calendar');

The calendar docs are here

Bob
niels77 22 Sep, 2009
FINALLY IT WORKED ! what a quest it was ! (for the search box: datepicker joomla 1.5 CF v2.5)

i combined the above codes :

<?php JHTML::_('behavior.calendar'); ?>
<script type="text/javascript" src="includes/js/joomla.javascript.js"></script>

<input class="inputbox" type="text" name="datum" id="datum" size="25" maxlength="10" value="" />
<a href="#" onclick="return showCalendar('datum', '%d-%m-%y');"><img class="calendar" src="templates/system/images/calendar.png" alt="calendar" /></a>

....dit it for me.

I've spent days on the forum trying to figure this out. There's far to much written about datepickers and calendars to simply find out how to get a calendar working on your J!1.5 with CF 2.5 , so this is it.
GreyHead 22 Sep, 2009
Hi Niels77,

Well found !!

Bob
rgfuller 18 Mar, 2010

FINALLY IT WORKED ! what a quest it was ! (for the search box: datepicker joomla 1.5 CF v2.5)

i combined the above codes :

<?php JHTML::_('behavior.calendar'); ?>
<script type="text/javascript" src="includes/js/joomla.javascript.js"></script>

<input class="inputbox" type="text" name="datum" id="datum" size="25" maxlength="10" value="" />
<a href="#" onclick="return showCalendar('datum', '%d-%m-%y');"><img class="calendar" src="templates/system/images/calendar.png" alt="calendar" /></a>

....dit it for me.

I've spent days on the forum trying to figure this out. There's far to much written about datepickers and calendars to simply find out how to get a calendar working on your J!1.5 with CF 2.5 , so this is it.




Hello,

Any ideas on how to make it work with J!1.5 and CF 3.1?

This code displays the textbox and datepicker icon on the form, but when I click it I get a JS error: Object doesn't support this property or method; /includes/js/joomla.javascript.js

Thanks very much in advance for any info or tips.
GreyHead 18 Mar, 2010
Hi rgfuller,

No idea - can you post a link to the form?

Is there some reason why you want to use the Joomla calenadar in place of the ChronoForms one? (I'm just curious).

Bob
GreyHead 19 Mar, 2010
Hi rgfuller,

FireBug shows a JavaScript error "calendar.hide is not a function" -- this could be because you have two sets of calendar JavaScript on the page and they are interfering.

Bob
GreyHead 20 Mar, 2010
Hi ron,

I got this working* (code below) but I had to turn off "Load Chronoforms CSS/JS Files?" for the form to avoid a JavaScript error.

Bob

* Thanks to this thread from the Joomla forums http://forum.joomla.org/viewtopic.php?f=304&t=288343

Form HTML:
<?php
if ( !$mainframe->isSite() ) {return;}
JHTML::_('behavior.calendar');
?>
<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Choose_date</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="date_0" name="date_0" type="text" /><img class="calendar" src="templates/system/images/calendar.png" alt="calendar" id="intro_date_img" />
  </div>
  <div class="cfclear"> </div>
</div>

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

Form JavaScript:
window.addEvent('domready', function() {
  Calendar.setup( {
    inputField  : "date_0",         // ID of the input field
    ifFormat    : "%Y-%m-%d",    // the date format
    button      : "intro_date_img"       // ID of the button
  });
});
GreyHead 22 Mar, 2010
Hi rgfuller,

At present that page has the ChronoForms JS files loading.

Bob
antsteinn 03 Apr, 2010
Hi.

Where can I find the includes/js/joomla.javascript.js codes?
GreyHead 03 Apr, 2010
Hi antsteinn,

In {root}/includes/js/joomla.javascript.js

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