I'm sure this is simple, and this is my understanding of jquery / javascript that holds me back, but I can't get it to work.
All I need to do is - When the button on the screen is pressed, clear part of the form input field to their original values.
This works fine for all fields except the datetimepicker field.
Here are the relevant bits of code that defines the input field:
<div class='form-group' id='START_DATEFormGroup'> <label for='START_DATE' class='col-sm-2 control-label' data-toggle='tooltip' data-placement='top' title=''>Start Date</label> <div class='col-sm-8'> <div class='input-group date form_date col-sm-3' data-date-format='dd M yyyy' data-link-field='START_DATE' data-link-format='yyyy-mm-dd'> <input class='form-control' size='16' type='text' /> <input type='hidden' id='START_DATE' name='START_DATE' /> <span class='input-group-addon'> <span class='glyphicon glyphicon-calendar'> </span> // group-addon </span> // calendar </div> // form_date </div> // col-sm-8 </div>
I initialize the datetimepicker as follows:
function enableDatepicker(){ $( document ).ready(function() { $('.form_date').datetimepicker({ format: 'dd M yyyy', minView: 2, autoclose: 1, }) }); }
To clear the input fields down, I:
function clearActionForm(){
So, can anyone give me the lines (codes) of code that I need to insert in clearActionForm () to clear the START_DATE field to zero.
Thanks.
source share