Hello,
I have 2 Date fields AFREIS and TERUGREIS. Date can be selected by datepicker.
When I select a date (by using datepicker) for my AFREIS value the intention is to put the same date in my TERUGREIS field. Unfortunately this only works after I select 2 times the same date.
The first time my date in the AFREIS field will be updated but not in the TERUGREIS field. If I select for the second time the same date in my AFREIS field then the TERUGREIS field will be updated.
CODE
=====
$col = array();
$col[“title”] = “Afreis”;
$col[“name”] = “AfreisDatum”;
$col[“width”] = “40”;
$col[“search”]=false;
$col[“editable”] = true; // this column is editable
$col[“editoptions”] = array(“size”=>20, “onblur”=>”update_EndDTG()”);
$col[“editrules”] = array(“required”=>true, “edithidden”=>false);
$col[“formatter”] = “date”;
$col[“formatoptions”] = array(“srcformat”=>’Y-m-d’,”newformat”=>’d-m-Y’);
$cols[] = $col;
$col = array();
$col[“title”] = “Terugreis”;
$col[“name”] = “TerugReis”;
$col[“width”] = “40”;
$col[“search”]=false;
$col[“editable”] = true;
$col[“editoptions”] = array(“size”=>20); // with default display of textbox with size 20
$col[“editrules”] = array(“required”=>true, “edithidden”=>false);
$col[“formatter”] = “date”;
$col[“formatoptions”] = array(“srcformat”=>’Y-m-d’,”newformat”=>’d-m-Y’);
$cols[] = $col;
function update_EndDTG()
{
$(‘#TerugReis’).val( $(‘#AfreisDatum’).val());
}
Try changing event ‘onblur’ to ‘onchange’. e.g.
$col["editoptions"] = array("size"=>20, "onchange"=>"update_EndDTG()");