Page 1 of 1

Change the value of a field in a subform string

Posted: Tue Jun 30, 2020 3:51 pm
by kknm
How to change the value of a field in a subform line using the js button from the main form, knowing the line number and field number?

Re: Change the value of a field in a subform string

Posted: Wed Jul 01, 2020 7:23 am
by kev1n

Code: Select all

var row = 3;

$('#your_subform_id' + nuPad(row) + 'your_field_id').val('hello').change();

Re: Change the value of a field in a subform string

Posted: Wed Jul 01, 2020 1:37 pm
by kknm
kev1n wrote:

Code: Select all

var row = 3;

$('#your_subform_id' + nuPad(row) + 'your_field_id').val('hello').change();
This does not work.
Where to find descriptions of many js functions, in particular nuPad.

Code: Select all

function zapoln_is_ves(event) {
   
    for (var i = 0; i <r.length-1; i ++) {
        nuAddRow('sub_hodki');
    $('#sub_hodki' + nuPad(i) + 'hod_kol').val('10').change();
    }
}   
Through trial and error, I found out that nuPad3 (i) works