Welcome Guest, Not a member yet? Register   Sign In
Anyone use the js calendar plugin in 1.6?
#1

[eluser]dmorin[/eluser]
I updated my site to 1.6 and my JS calendar isn't working. So, after checking it out, it's failing to call the insert_date() function. Apparently in 1.6 (at lease in my version) that function has been commented out.

It doesn't look like the interface has changed and uncommenting the function works fine. Does anyone know anything about the change? Thanks.
#2

[eluser]phpwebdev[/eluser]
Yep i have similar problem too
Sad


But ... im clever Smile
Do that
1) Download CI 154
2) After that replace 2 plugin files (153->161).

And have fun

Regards
phpwebdev
#3

[eluser]Taff[/eluser]
I am also having some issues trying to get the calendar plugin to work.

I ahve it displaying, but for some reason it isn't populating the field it should be (it should be shouldn't it?)

I'm following the instructions:

Code:
$this->load->plugin('js_calendar');

is being called in my controller. I am echoing out the Javascript and CSS. Both can be found in my source code and the form has the same name as
Code:
<?php echo js_calendar_script('my_form');  ?>

I am however using version 1.6.1 CI, and after some searching I have found this post.

Quote:Do that
1) Download CI 154
2) After that replace 2 plugin files (153->161).

Even removing the comments around insert_date seem to make no difference. Sad

Thanks for any help!
Taff
#4

[eluser]Taff[/eluser]
I've spent quite sometime trying to get this to work.
Does it work with 1.6.1 for anyone?

I installed firebug to help me find the solution, but I am at a loss, and hopefully soemone with more JavaScript knowledge can show me the light, the error looks like this:

Code:
fval has no properties
insert_date(Object id=myform highlight=true)
set_date(td#myformselected.caldayselected, Object id=myform highlight=true)
onclick(click clientX=0, clientY=0)
[Break on this error] if (fval.value == '')

These are the steps and relative code:

In my header I have:
Code:
echo js_calendar_script('myform');
and all the CSS that is required (not posted as it is displaying properly and everything is clickable, months go back and forth etc.)

The output from my header and view seems to look OK:
Code:
&lt;form action="http://localhost/p_p/index.php/project/add" method="post" name="myform"&gt;        <label for="name">Title:</label>&lt;input type="text" name="title" value="" /&gt;<br />
<label for="notes">Notes:</label>&lt;textarea name="notes" rows="10"&gt;&lt;/textarea&gt;<br />
<label for="company">Company:</label>
<select name="company">
  <option value="0">- - - - - -</option>
  <option value="1">new name</option>
  <option value="2">Company 2</option>
  <option value="3">New client</option>
  <option value="11">A new client joins us</option>
</select><br />

  var myform = new calendar("myform", 1208878890, true);
  [removed](myform.write());
                            
&lt;input type="text" name="start" value="" onblur="alert(this.name);update_calendar(this.name, this.value);" /&gt;
<p>&lt;a href="[removed]void(0);" onClick="set_to_time('start', '1208878890')" &gt;Today</a></p>
&lt;input type="submit" class="button" value="Create Project" /&gt;
&lt;/form&gt;

If anyone has any ideas, I would be so grateful!
Spent more time on this bit than the rest put together Smile

Taff
#5

[eluser]Taff[/eluser]
For anybody wanting to embed a datepicker I can highly recommend http://www.kelvinluck.com/assets/jquery/...r/v2/demo/ especially if you are using JQuery anyway. It took less than 5 minutes to setup and get working.
Beyonds as how I will only need the picker on pages that edit or add data I added

Code:
&lt;?php if($this->uri->segment(2) =='add' OR $this->uri->segment(2)=='edit'){ ?&gt;
&lt;link rel="stylesheet" type="text/css" href="&lt;?php echo base_url();?&gt;css/datePicker.css" /&gt;
&lt;!-- jQuery --&gt;

&lt;!-- required plugins --&gt;

&lt;!-- jquery.datePicker.js --&gt;


    $(function()
        {
            $('.date-pick').datePicker({clickInput:true})
        }
    );

&lt;?php } ?&gt;

Hope this helps someone.

Taff
#6

[eluser]Unknown[/eluser]
Hi, i happen to have the same problem like you guys, can't apply datePicker using jquery v 1.6. Then i come up with this forum page when i try to find the solution in Google.

FYI, for the datePicker, i also use the one from http://www.kelvinluck.com/assets/jquery/...r/v2/demo/, but still not working, sigh!!! Dunno why...

Anymore bright idea guys?

Thanks in advance.

[quote author="Taff" date="1208911469"]For anybody wanting to embed a datepicker I can highly recommend http://www.kelvinluck.com/assets/jquery/...r/v2/demo/ especially if you are using JQuery anyway. It took less than 5 minutes to setup and get working.
Beyonds as how I will only need the picker on pages that edit or add data I added

Code:
&lt;?php if($this->uri->segment(2) =='add' OR $this->uri->segment(2)=='edit'){ ?&gt;
&lt;link rel="stylesheet" type="text/css" href="&lt;?php echo base_url();?&gt;css/datePicker.css" /&gt;
&lt;!-- jQuery --&gt;

&lt;!-- required plugins --&gt;

&lt;!-- jquery.datePicker.js --&gt;


    $(function()
        {
            $('.date-pick').datePicker({clickInput:true})
        }
    );

&lt;?php } ?&gt;

Hope this helps someone.

Taff[/quote]
#7

[eluser]munko[/eluser]
hi,

i'm new to CI, and currently using ci 1.7

i have the same problem using the calendar library,

i tried to remove

Code:
cal = eval(cal);

on the insert_date function

because cal is an object

and it works for me,

hope it helps you

(pardon my english)

cheers
munko




Theme © iAndrew 2016 - Forum software by © MyBB