I am having trouble getting a Javascript click event button to lock fields in a subform. I have downloaded Paul's PO form and copied the script but it still didn't work. I changed the (form1) to my subform name and put the button in subform under the hierarchy but still nothing. I also saved the form as a dynamic pdf and tried other things that were suggested in other posts but I'm stuck.
Should a myscriptoject variable come up?
When I ctrl+J in the preview pdf tab I get the following error: "myScriptObject is not defined"
What am I missing?
Thanks,
Joe
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Joe,
Paul's example also contains a script object (look in the hierarchy for myScriptObject under Variables). This script object contains the LockAllFields function that is called from the click event of the button. The function does all of the work.
You can drag this script object to your fragment library, which will then make it available to you in other forms. In your form you would drag it from the library into the hierarchy, over the first page. It will insert the fragment into Variables. You can then right-click on the fragment and convert it to an embedded object.
It should work then,
Niall
Views
Replies
Total Likes
Hi Joe,
Paul's example also contains a script object (look in the hierarchy for myScriptObject under Variables). This script object contains the LockAllFields function that is called from the click event of the button. The function does all of the work.
You can drag this script object to your fragment library, which will then make it available to you in other forms. In your form you would drag it from the library into the hierarchy, over the first page. It will insert the fragment into Variables. You can then right-click on the fragment and convert it to an embedded object.
It should work then,
Niall
Views
Replies
Total Likes
Niall,
That did it. Thank you. I knew there was more too it then just pasting the script in the click event. I just wasn't sure where too put the myscriptobject function that I saw in Paul's variables. Now I have a little better understanding of what the fragment library is for. Thanks again.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies