hi to all, i have a problem when inserting my form with yiiwheels timepicker
i used this code but everytime i submit the form time field is blank
this is my code:
<?php $this->widget(
'yiiwheels.widgets.timepicker.WhTimePicker',
array(
'model'=> $model,
'attribute'=> 'time',
'name' => 'timepickertest'
)
);?>
I suggest you need to set default date. so by default you can set or show today date as default date.
where can i set default date on my validation rules?im trying to insert time… thank you
Sorry i’m telling about time . can you show me your WhTimePicker js code???
so, will help you to set default date or time.
You can two way to set default date or time.
eg. (js code) -
$('#example').datetimepicker({
hour: 00,
minute: 00
});
or
.datetimepicker("setDate", new Date());
my WhTimePicker js ? is default fresh download from yiiwheels site… my problem is why i cant submit my time field, i select time, and i got an error time cannot blank…
here is my code, did i miss something…
<?php $this->widget(
‘yiiwheels.widgets.timepicker.WhTimePicker’,
array(
‘model’=> $model,
‘attribute’=> ‘time’,
‘name’ => ‘timepickertest’
)
);?>
my WhTimePicker js ? is default fresh download from yiiwheels site… my problem is why i cant submit my time field, i select time, and i got an error time cannot blank…
here is my code, did i miss something…
<?php $this->widget(
‘yiiwheels.widgets.timepicker.WhTimePicker’,
array(
‘model’=> $model,
‘attribute’=> ‘time’,
‘name’ => ‘timepickertest’
)
);?>
Can you show me your view and action controller whole code???
Put WhTimePicker inside form give the action to your action controller, so there you can access using time name which your are giving for time.
Or create an ajax call to post date or time to action controller function.
alirz23
(Ali Raza)
August 10, 2014, 9:18am
10
do a var_dump in your controller and see if you getting the input value
<?php
var_dump($_POST);
die;