Master and Detail add auto compute qty based on input from January to December

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
JAYM
User
Posts: 31

Master and Detail add auto compute qty based on input from January to December

Post by JAYM »

Master and Detail add auto compute qty based on input from January to December

I have this detail add table where i want the qty to auto compute based on the input fields January to December.
this occurs when adding on master and detail add.

Thanks for your Help.


arbei
User
Posts: 9384

Post by arbei »

You may use Client Side Events for the quantity fields, your "change" handler should all inputs for all months and them sum the values up. Try and write your code, if it does not work, you may post for discussion.


JAYM
User
Posts: 31

Post by JAYM »

To test it I put this code to the qty client side event but still does not work

{ // keys = event types, values = handler functions
	"change": function(e) {
		var $row = $(this).fields(); // Get an object of all fields, each property is a jQuery object of the input element(s) of a field
        var st = $row["jan"].toNumber() + $row["feb"].toNumber(); // Convert to number and calculate
        $row["qty"].value(st); // Set result to a field
	}
}

arbei
User
Posts: 9384

Post by arbei »

Your code implies that:

  1. The fields "jan", "feb", and "qty" are all in the same row.
  2. You add your listener to the "qty" field, it will only be triggered when you change the "qty" and then it updates itself.
    Are you sure it is correct?

JAYM
User
Posts: 31

Post by JAYM »

I change the "change" to "keyup" now its working.. thank you for your help thanks a Lot


Post Reply