Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Change the value of a field in a subform string

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Change the value of a field in a subform string

Unread post 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?
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

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

Unread post by kev1n »

Code: Select all

var row = 3;

$('#your_subform_id' + nuPad(row) + 'your_field_id').val('hello').change();
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

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

Unread post 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
Post Reply