to pull user data into a complex custom form loaded via iframe which is only accessible to logged in users.
What I must achieve to make my new version of this form work, is to be able to dynamically (via ajax) test for user logged in status to enable a 'Save' button.
So, unregistered user can view the form and play with it with disabled/hidden 'Save' button. Then, if they want to save/submit the data they have to login or register (via modal or pop-up window) then they will be able to submit/save the form…
Use of {$auth.user_id} should also work. But if not, using {$smarty.session.auth.user_id} would do the same and prevent the overhead of any ajax requests.
Thank you for that - my reasoning for ajax call is that I do not want the visitor to have to reload the form i.e.
Visitor/User Plays With Form [not logged in/registered] > Visitor then wants to save/submit their input > Link to Log-in/Register [new tab/modal window] > Enable ‘Save/Submit’ Button > Bingo! [Without re-loading form].
I could of course just set a cookie to save the the form values temporarily for non logged in / registered visitor but I would prefer not to do it that way… there is also quite a lot of data / fields in the form…