If I put the "Process Fields" group on my form, when the form comes up in the WorkSpace, there is an "Offline" button at the lower-left. I can click that button and save the form as a PDF file, and I can operate the PDF form outside the WorkSpace. It all works great.

My question is, is there a way for my Javascript (inside the form) to tell if the form is currently in the WorkSpace (online) or if it is currently "offline"?

suppose I have a button on the form that only works when the form is in the WorkSpace, so, when the user takes the form Offline, I would like to hide that button when he opens the form outside of the WorkSpace.

and vice versa,

I might want to put something on the form that only makes sense when the user is operating the form outside the WorkSpace. I would like to hide those things when the form is launched inside the WorkSpace.

I was also thinking about the similar solution. The problem here is, when you save the Offline form to the file system, the hidden information set by the Prepare Date process will still be there. So the Javascript will assume that its an online form. Got my point?

We can still play with this approach using timestamp verification; i.e the form rendered time & the javascript execution time must be same (with slight negotiable duration). Do you think this will workout?

Yes, I understand your point. How about setting your indicator back to offline on the pre-save event of the form? The form must assume by default that its offline unless its opened by the process. Once the form is saved, its considered offline... yes?