Change the value of a field in a subform string

Questions related to customising nuBuilder Forte with Javascript or PHP.

Change the value of a field in a subform string

Postby kknm » Tue Jun 30, 2020 11:21 pm

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?
kknm
 
Posts: 139
Joined: Sat Apr 11, 2020 7:33 am

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

Postby kev1n » Wed Jul 01, 2020 2:53 pm

Code: Select all
var row = 3;

$('#your_subform_id' + nuPad(row) + 'your_field_id').val('hello').change();
kev1n
 
Posts: 784
Joined: Mon Oct 15, 2018 2:13 am

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

Postby kknm » Wed Jul 01, 2020 9:07 pm

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
kknm
 
Posts: 139
Joined: Sat Apr 11, 2020 7:33 am


Return to Custom Code



cron