custom field total not refresh

I created a field “total” with “add custom file” that calculates ‘prz’ * ’ Qnt’

{ // keys = event types, values = handler functions
“change keyup”: function(e) {
var $row = $(this).fields();
var st = $row[“Prezzo”].toNumber()*$row[“Quantita”].toNumber();
$row[“Importo_Riga_Ord”].value(st); // assigncon in add

works properly while in “add record”.

with “editrecord” the field “total” remains value 0 to recalculate the field I have to insert new data on the field “Qnt” ; how can i make a refresh custom field “total” to bring back thetotal correct ??

tnk.

You need to add the event to both the prz and Qnt fields.

For “Edit Page”, you may simply use “Row_Rendered” server event in order to re-calculate the total by assigning the “EditValue” property of that custom field, for example:

if (CurrentPageID() == “edit”) { // make sure only for Edit Page
// assume all these following three textboxes are enabled in Edit mode/page
$this->total->EditValue = intval($this->Prezzo->EditValue) * intval($this->Quantita->EditValue);
}

remain the same problem on the screen “list” how can i solve?

For “List” and “View” page, you may also use “Row_Rendered” server event:

if (CurrentPageID() == “list” || CurrentPageID() == “view”) {
$this->total->ViewValue = intval($this->Prezzo->CurrentValue) * intval($this->Quantita->CurrentValue);
}

I had already entered this line; the value remains 0.

Make sure both “Prezzo” and “Quantita” have been included/enabled to be displayed in List Page, and both values are not empty.

I entered this line
if (CurrentPageID() == “edit” || CurrentPageID() == “list” || CurrentPageID() == “view”);{…

and the quantity and price field are activated.
I would like to display only Total if possible.

The code for Edit Page is difference with the code for List and View page. Therefore, you should not combine the logic by using that code.

ok it works properly
thanks