Client Script to save data in a custom field

I create a custom field in the Salary Sip, In the form the calculation is good, but in the database the field is not been filled (has a 0 value).
This is the test that im doing :

frappe.ui.form.on(“Salary Slip”, {
onload: function(frm) {
frm.doc.prueba = frm.doc.gross_pay*1/100;
}
});

There is a way to do this without Server side script? Am I mising something?

PS: I’m new in all this.

Try frm.fields_dict.prueba.set_value(frm.doc.gross_pay*1/100)