Update datepicker field using "onblur"

QuestionsUpdate datepicker field using "onblur"
Hendrickx Willy asked 2 years ago

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());

}

1 Answers
Abu Ghufran Staff answered 2 years ago

Try changing event ‘onblur’ to ‘onchange’. e.g.

$col["editoptions"] = array("size"=>20, "onchange"=>"update_EndDTG()");
_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

15 + 19 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?