Page 1 of 1

Need example of NuSetHash

Posted: Mon May 30, 2016 3:52 pm
by jegalink
I'm not very familiar with JavaScript - so I wonder if someone could give me a very basic example of how to use NuSetHash to pass a variable (in this case, an ID from a related table) from one edit form that submits data (using a button object with recordID set to -1) to another edit form in series (both forms are not open at once). The second edit form will need to submit the variable value to a third form, like an html hidden form field would do. Any form field name or value will be fine on the example. I just need to see an example of basic syntax for this that works - and where that code would be inputed in the nuBuilder globeadmin interfaces. Thanks for any help!

Re: Need example of NuSetHash

Posted: Tue May 31, 2016 1:46 am
by admin
jegalink,

Have you seen the wiki? http://wiki.nubuilder.net/nubuilderv3/i ... _Variables

Steven

Re: Need example of NuSetHash

Posted: Wed Jun 01, 2016 4:58 pm
by jegalink
Yes, I sure have. But I think the documentation on this presupposes a good working knowledge of Javascript, which I don't have. I don't know where/how to use the nuSetHash() or nuGetHash() JavaScript functions to pass a variable value from one edit form to another edit form. I'm trying to read up a bit on Javascript, but it's slow going. Perhaps I'll get there on my own - I just thought if there is a simple example I could follow, that would speed things up.

Thanks though.
admin wrote:jegalink,

Have you seen the wiki? http://wiki.nubuilder.net/nubuilderv3/i ... _Variables

Steven

Re: Need example of NuSetHash

Posted: Thu Jun 02, 2016 2:55 pm
by hanstel

Re: Need example of NuSetHash

Posted: Fri Jun 03, 2016 12:04 am
by jegalink
Yes, I saw that one. I searched quite a lot before posting my questions. The interplay between the JavaScript object and the hash variables server side (that can be used in the subsequent form), if there is any, is what I'm not understanding. I also was just asking for a simple syntax example of where/how nuSetHash could be used to accomplish this interplay, if indeed it could.

Thanks for the responses - I realize I may be asking too much. I'll keep poking around with some trial and error on my own.

Re: Need example of NuSetHash

Posted: Fri Jun 03, 2016 1:43 am
by jegalink
OK, I put the following line (all by itself) into Custom Code > Javascript for FORM A (which I then access as an edit form):

Code: Select all

nuSetHash('tester', 'blabla');
FORM A (as an edit form) has a button object which, when clicked, directs to FORM B with the record ID set to -1 (to pull up a new blank edit form).
I put the following line of code into Custom Code > Before Open for FORM B:

Code: Select all

nuDisplayError('#tester#');
The error message that pops up when I click the button on FORM A shows this:
#tester#
Obviously I'm missing something elementary here, and probably showing my ignorance (already admitted) of Javascript, but am I anywhere near being on the right track?

Re: Need example of NuSetHash

Posted: Thu Aug 11, 2016 1:43 am
by admin
jegalink,

I tried to do the same and it worked..

(if you hit F12 you will get developer tools)
Capture7.PNG
Capture7.PNG (62.87 KiB) Viewed 12370 times
nuSetHash() adds a variable to nuFORM.

Is your system doing that?

Steven