Global script basis
Hi,
I want to use the same form definition on multiple sites. Therefore it is necessary to keep all scripts in a single file (globally) to keep the maintenance easy.
I tried to use a HTML snippet with the path to the script file, but still get some error messages. Especially if I try to use fd. object selector.
What is the best way to do so (I'm on SharePoint Online)?
br, Alex
I want to use the same form definition on multiple sites. Therefore it is necessary to keep all scripts in a single file (globally) to keep the maintenance easy.
I tried to use a HTML snippet with the path to the script file, but still get some error messages. Especially if I try to use fd. object selector.
What is the best way to do so (I'm on SharePoint Online)?
br, Alex
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Hello, Alex!
It should work the way you tried, by imbedding <script src=""></script> into the the HTML element on the form.
Please make sure you imbed HTML snippet into an HTML element, not in JS code or somewhere else. Other than that, you can try running this simple code in a separate file from a form and tell us the results:
It might take a few seconds for a form to update, but if there are still errors, screenshots might help us determine what exactly goes wrong.
It should work the way you tried, by imbedding <script src=""></script> into the the HTML element on the form.
Please make sure you imbed HTML snippet into an HTML element, not in JS code or somewhere else. Other than that, you can try running this simple code in a separate file from a form and tell us the results:
Code: Select all
alert(fd.field('Title').value());
Cheers
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
That's strange, because fd should be initialized by the time any of the elements load, including HTML element.
Can you tell us your version of the Forms Designer? You can check it in the bottom right corner of the app:
Can you tell us your version of the Forms Designer? You can check it in the bottom right corner of the app:
Cheers
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Okay, we'll need more information to determine the cause of this.
Can you provide us your brower's full console log?
Can you provide us your brower's full console log?
Cheers
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Okay, let us know if you have any trouble again.
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 5 guests