EllisLab text mark
Advanced Search
     
Problem with date picker
Posted: 05 January 2012 01:50 AM   [ Ignore ]
Avatar
Joined: 2011-12-06
76 posts

Hello Guys! I’m having trouble with my date picker. The date picker doesn’t show up when I click its designated button. Can you help me with this? Here’s my code for it:

$sod = array('name'=>'sod''maxlength'=>'10','size'=>'15''readonly'=>'readonly''value'=>$this->input->post('sod'));
  
$sod_data = array('name' => 'button''class' => 'elipses''value' => 'true','content' => '...''onclick'=>"displayDatePicker('eod', false, 'ymd', '-');");
  
$this->table->add_row($this->util->set_label('Start of Development *'),form_input($sod).spacer.form_button($sod_data));
  
  
$eod = array('name'=>'eod''maxlength'=>'10','size'=>'15''readonly'=>'readonly''value'=>$this->input->post('eod'));
  
$eod_data = array('name' => 'button''class' => 'elipses''value' => 'true','content' => '...''onclick'=>"displayDatePicker('eod', false, 'ymd', '-');");
  
$this->table->add_row($this->util->set_label('End of Development *'),form_input($eod).spacer.form_button($eod_data)); 

Thanks in advance for your help!

 Signature 

-Nicx

 
Posted: 05 January 2012 10:18 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-12-06
76 posts

Solved it myself. Hope this helps others too!

$sod = array('name'=>'sod''maxlength'=>'10','size'=>'15''readonly'=>'readonly''value'=>$this->input->post('sod'));
  
$sod_data = array('name' => 'button''class' => 'elipses''value' => 'true','content' => '...''onclick'=>"displayDatePicker('sod', false, 'MMDDYYYY', '-');");
  
$this->table->add_row($this->util->set_label('Start of Development *'),form_input($sod).spacer.form_button($sod_data));
  
  
$eod = array('name'=>'eod''maxlength'=>'10','size'=>'15''readonly'=>'readonly''value'=>$this->input->post('eod'));
  
$eod_data = array('name' => 'button''class' => 'elipses''value' => 'true','content' => '...''onclick'=>"displayDatePicker('eod', false, 'MMDDYYYY', '-');");
  
$this->table->add_row($this->util->set_label('End of Development *'),form_input($eod).spacer.form_button($eod_data)); 

I changed the date format from ‘ymd’ to ‘MMDDYYYY’. Don’t know exactly why, if someone can tell me it’ll be great. smile Thanks!

 Signature 

-Nicx

 
Posted: 06 January 2012 03:03 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2010-11-02
97 posts

paste the function as well! so we can help u better :D