Where to place our custom client side javascript File?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 01:37 AM
Hi,
I have created a custom javascript file. Which have methods
function myFunction(){ var x = document.forms["leadDetasilsform"]["leadName"].value; if (x == "") { alert("Name must be filled out"); return false; } }
I have created a Button in dashlet's ftl file and on this button click i have to call a function.
How to use/import separate js file for the form validation created in webscript?
At which location should I put my js for the form validation?
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 06:14 AM
It is up to you where to place the file. You just need to import it with the correct path either via a Surf extension module dependency customisation or a configuration as a form dependency. Maybe you should re-read your certification preparation material, the documentation about writing dashlets, or some of the examples.
As for hooking in a function for form validation, it completely depends on how you build the form. From your previous questions I assume you are writing a completely custom form without using any of the capabilities that Alfresco already provides, so it is completely up to you...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 07:53 AM
Thanks Axel,
Now,I am thinking that I would have to re-read my certification preparation material again.
I tried many times to import external js to my ftl file. But i can't get result.
