Hi,
my simple form (only one calendar field) load record 1 of a table and with a submit button it save on the same record. it work perfectly,
but if i delete the time and i left empty it save on the table the actual time . iI would like to save an empty value.
here some screeshot:




thanks in advance
my simple form (only one calendar field) load record 1 of a table and with a submit button it save on the same record. it work perfectly,
but if i delete the time and i left empty it save on the table the actual time . iI would like to save an empty value.
here some screeshot:
thanks in advance
try not calling the field date or time. And make sure your table isn't set to give that date field a default.
Hi, thank you for the reply
i chande the name but it doesn' t work.


i also tried to flag NULL but it save the actual time.
i chande the name but it doesn' t work.
i also tried to flag NULL but it save the actual time.
i also tried a custom code before the save data:
if(empty($this->data["t1me"])){
unset($this->data["t1me"]);
}
same result
if(empty($this->data["t1me"])){
unset($this->data["t1me"]);
}
same result
Try adding the field to the list of fields in Override on Update and override on Insert maybe
nothing, same result...
is it saving the current time, or showing the current time when you load the form
Also, put a debug after your save data and paste it here to show what's being put in the save_data action
it load the db value, if i modify it save the new time and reload it. if i delete and leave the field empty it save the current time
Sorry the print was wrong
here the correct one:

thanks
here the correct one:
thanks
Yeah it seems that the calendar field puts the current date / time into the hidden field when you delete the text. You'd probably have to put a custom javascript function in and set the onchange event to check if the input is empty and use that to wipe the data field.
Hi, hatman , i tried different approaches but seem it depend from the datapicker code...
I also tried the php code suggest by Max
if(empty($this->data["t1me"])){unset($this->data["t1me"]);}
if the datapicker find the field empty , it set the actual date...
I would not give up to use a simple text field and handwrite the date ...
I also tried the php code suggest by Max
if(empty($this->data["t1me"])){unset($this->data["t1me"]);}
if the datapicker find the field empty , it set the actual date...
I would not give up to use a simple text field and handwrite the date ...
The PHP code suggested by Max won't work, you'll need to do what I said because even though the text field is empty the hidden field that actually stores the data is what gets sent when you submit a calendar field, and it gets set to the current date when you clear the text field.
Max do you have any tips for the datapicker (calendar field) ?
ok hat , but how i reach this hidden field? its name?
Right click field, "inspect". The hidden field is right after your visible date field.
sorry, you could tell me where to look:
This topic is locked and no more replies can be posted.