If the scripts are marked as "run at server" then Output should run them before it flattens the form.
If you are looking to execute scripts client side after the form is flattened, then you are out of luck. The document that Output generates really isn't a form anymore - the fields are turned into text - so there is nothing for the scripts to run against.
Interesting...I thought that was the answer, but when I tried that it didn't seem to work. I'll try it again to make sure.
Just for my information, would choosing to run the scripts at "client and server" have the same effect?
Thanks for the help,
Yes, running the scripts as both should work.
Still not working for some reason. I'm flattening it through Output and I have that script set to run at the Server, but I'm not getting the results I want. My hidden fields aren't showing up on the flattened version like they are on the non-flattened version. I have the JS in the docReady event. Would putting it in a different event help? Anything else I can check?
So here's some additional information. I was able to get this code to work on the server:
Ultra_Form.Page1.Buttons.SaveAndClose.presence = "visible";
But the code below will not run correctly on the server (although it will run on a non-flattened form on the client):
Ultra_Form.Page2.presence = "visible";
Ultra_Form.Page2.TF1.presence = "visible";
Essnetially what I'm wanting to do is show a page that is set to "Hidden (Exclude from Layout)". Works on the client, but not on the server so far.
I do this all the time without any problem.
Are there conditions around the lines that set the visible property? Maybe the conditions are failing and the lines aren't being executed.
Also, try the operation and check the logs on the server; there might be an error occurring in the script that you can't see.
I removed the if condition last night and it still wasn't working. Not sure what the problem is.
I'll check the logs like you suggest. Thanks.
So here's what I think is happening. This code looks like it will work if run on the server if the element is set to invisible, but not if it is set to "Hidden (Exclude from Layout)". While that's annoying (I really wanted my elements to be set to Hidden), at least I think I see what's going on now. I'll see if I can re-architect my code and form in some way to get the result I want.