I have a form, user logs in and another form is generated.
User submits a query. My problem is that I cannot keep a record of who is making the query.
The user has a uid and usernamae but once the new form is generated where the user submits the query both these identifiers are gone.
Is there a way in which I can overcome this? Thanks
If you’re storing your UIDs only in the initial form, you’ll need to pass in these values to the new form.
In essence, you could adjust your fields scopes and store your value in a place accessible by both forms, pass them into a constructor (and store accordingly), or provide an accessor in your new form to pass through the values you need.
To answer your question on the constructor:
Your code currently probably looks like the following:
You’ll need to modify the constructor of the second form such as:
…should become…
And then pass in your values from the first form (where userId and userName are fields storing form1’s values):
Then you could store them in your second form’s global scope.