Welcome to the nuBuilder Forums!

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

Get field values ​​from browseForm

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

Get field values ​​from browseForm

Unread post by kknm »

The main form has several view forms filtered by value from the select object.
Now I need to get the first values ​​from browseForms on click from and write them to several inputboxes, each inputbox should get values ​​from different forms.
jurnal.png
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Get field values ​​from browseForm

Unread post by kev1n »

Example to access a cell value in an iframe:

Code: Select all

var f = $("#your_frame_id")[0].contentWindow;
var cellVaue = f.$('#nucell_1_1').html();
With the latest version, it's even easier:

Code: Select all

var cellVaue = nuGetIframeValue('your_frame_id','nucell_1_1','html);
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Get field values ​​from browseForm

Unread post by kknm »

kev1n wrote:Example to access a cell value in an iframe:

Code: Select all

var f = $("#your_frame_id")[0].contentWindow;
var cellVaue = f.$('#nucell_1_1').html();
With the latest version, it's even easier:

Code: Select all

var cellVaue = nuGetIframeValue('your_frame_id','nucell_1_1','html);
How do I get the value using nuSelectBrowse?
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Get field values ​​from browseForm

Unread post by kev1n »

Code: Select all

function nuSelectBrowse(e) {

  let cellValue = e.target.innerText;
  nuMessage([cellValue]);

}

kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Get field values ​​from browseForm

Unread post by kknm »

kev1n wrote:

Code: Select all

function nuSelectBrowse(e) {

  let cellValue = e.target.innerText;
  nuMessage([cellValue]);

}

Now how do you insert this value into the inputbox of the main form?
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Get field values ​​from browseForm

Unread post by kev1n »

Code: Select all

function nuSelectBrowse(e) {

  let cellValue = e.target.innerText;
  parent.$('#input_id_main_form').val(cellValue).change();

}
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Get field values ​​from browseForm

Unread post by kknm »

Now everything works ... but the form (:: RUN) from which the value (cellvalue) is obtained is zeroed, i.e. Loses the filter by which it was filled.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Get field values ​​from browseForm

Unread post by kev1n »

try omiting .change(); if the value in the input doesn't have to be saved in the database.

or use this line instead:

Code: Select all

 parent.$('#input_id_main_form').val(cellValue).addClass('nuEdited');
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Get field values ​​from browseForm

Unread post by kknm »

Omitted onchange - now everything is correct. Thanks!
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Get field values ​​from browseForm

Unread post by kknm »

Another question arose...
How to get multiple values ​​from one row on click (nuSelectBrowse)?
Post Reply