Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Get field values from browseForm
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Get field values from browseForm
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.
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.
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 446 times
- Contact:
Re: Get field values from browseForm
Example to access a cell value in an iframe:
With the latest version, it's even easier:
Code: Select all
var f = $("#your_frame_id")[0].contentWindow;
var cellVaue = f.$('#nucell_1_1').html();
Code: Select all
var cellVaue = nuGetIframeValue('your_frame_id','nucell_1_1','html);
-
- 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
How do I get the value using nuSelectBrowse?kev1n wrote:Example to access a cell value in an iframe:
With the latest version, it's even easier:Code: Select all
var f = $("#your_frame_id")[0].contentWindow; var cellVaue = f.$('#nucell_1_1').html();
Code: Select all
var cellVaue = nuGetIframeValue('your_frame_id','nucell_1_1','html);
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 446 times
- Contact:
Re: Get field values from browseForm
Code: Select all
function nuSelectBrowse(e) {
let cellValue = e.target.innerText;
nuMessage([cellValue]);
}
-
- 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
Now how do you insert this value into the inputbox of the main form?kev1n wrote:Code: Select all
function nuSelectBrowse(e) { let cellValue = e.target.innerText; nuMessage([cellValue]); }
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 446 times
- Contact:
Re: Get field values from browseForm
Code: Select all
function nuSelectBrowse(e) {
let cellValue = e.target.innerText;
parent.$('#input_id_main_form').val(cellValue).change();
}
-
- 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
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.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 446 times
- Contact:
Re: Get field values from browseForm
try omiting .change(); if the value in the input doesn't have to be saved in the database.
or use this line instead:
or use this line instead:
Code: Select all
parent.$('#input_id_main_form').val(cellValue).addClass('nuEdited');
-
- 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
Another question arose...
How to get multiple values from one row on click (nuSelectBrowse)?
How to get multiple values from one row on click (nuSelectBrowse)?