Page 1 of 1

Transfer a Value into a new Form

Posted: Fri Mar 05, 2021 2:29 pm
by getNo
hey there,

first of all i am a German native , you will see on the screenshots, so my English is not the prettiest. as you will notice in the screenshots, i turned the color theme to red for buttons etc.

I have this edit form with a jstree via html-object
2021-03-05 14_04_17-nuBuilder - Anfragebaum_IB.png

to use the buttons below, the user has to select an active node of the tree. so the node-id is set as an value.
2021-03-05 14_02_21-nuBuilder - Anfragebaum_IB.png
With the Button "Annehmen", i go into a new form. How can i get the value of the field or the node into the new form? the new form must be a edit form with a new record set and the field is not the primary key.
2021-03-05 14_11_26-nuBuilder - Anfrage_Annehmen.png

the code for the activated node:
2021-03-05 14_09_51-nuBuilder - Anfrage_Data.png



i hope my question is clear. Surely it is a easy proplem for you, but i am a bit noobish on web-development.

Re: Transfer a Value into a new Form

Posted: Fri Mar 05, 2021 3:04 pm
by kev1n
When the button "Annehmen" is clicked assign the value of Anfrage_His_ID to a variable AnfHisID. Use the button's onclick event in the Custom Code tab:

Code: Select all

window.AnfHisID = $('#Anfrage_His_ID').val();
custom_code.png
Then, in the new form, retrieve the value and assign it to AnfHisID.

Code: Select all

if (nuFormType() == 'edit') {
   $('#AnfHisID').val(window.AnfHisID);
}
I hope that helps.

Re: Transfer a Value into a new Form

Posted: Sat Mar 06, 2021 4:59 pm
by getNo
worked as expected. thank you.

Update: well not completely.
The field is filled corectly, but when i save the form, without editing the Anfrage_His_ID, it becomes Zero in the Database.

Re: Transfer a Value into a new Form

Posted: Sat Mar 06, 2021 6:16 pm
by kev1n

Code: Select all

$('#AnfHisID').val(window.AnfHisID).change()

Re: Transfer a Value into a new Form

Posted: Sat Mar 06, 2021 6:53 pm
by getNo
thanks