Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Hash variables - server-side and client-side

Post Reply
jegalink
Posts: 16
Joined: Mon Feb 09, 2015 6:17 pm

Hash variables - server-side and client-side

Unread post by jegalink »

I have a conceptual question about hash variables after reading all the wiki documentation on hash variables and functions:

I understand that when hash variables are used in fields, php scripts, etc - they are replaced by the corresponding hash values before anything is run or interpreted. I'm assuming that all happens server-side when a form or other event is submitted by the client to the server. However, the nuSetHash() function is javascript, which is client-side functionality, right? So does that only set the value of the hash variable for the client? How does that get handed back to the server so it can be used in whatever form or output that comes next?

Thanks!
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Hash variables - server-side and client-side

Unread post by admin »

jegalink,

If you ran this in JavaScript (on the client side).

Code: Select all


   nuSetHash('new_color','red');

if you then had a hash variable in the php code On Save eg.

Code: Select all


   if ('#new_color#' == 'red'){

      doSomething();

   }

creating..

Code: Select all


   if ('red' == 'red'){

      doSomething();

   }

Steven
Post Reply