Adding data on create
Adding data on create
nskwortsow
Posts: 120Questions: 0Answers: 0
Hi Allan,
on CREATE, I want to add data for a field (i.e. DateAdded(YMD))
This field should not be visible in the editor and should only be applied upon a NEW record (i.e. CREATE).
Any pointers?
N
on CREATE, I want to add data for a field (i.e. DateAdded(YMD))
This field should not be visible in the editor and should only be applied upon a NEW record (i.e. CREATE).
Any pointers?
N
This discussion has been closed.
Replies
Please point me in the right direction.
http://editor.datatables.net/release/DataTables/extras/Editor/examples/tableOnlyData.html
For the first, I would actually suggest that you use SQL to do that. Simply set the value of the timestamp to current time on create. Depending on what SQL database you are using there are different ways of doing that (a 'insert' trigger).
It could be done in Javascript with a hidden field, or in PHP by intercepting the submit and adding the required value in, but I'd suggest using the database since that is where the data must ensure its integrity.
Allan