How can we a call client script from another client script, any examples please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 11:05 PM
How can we a call client script from another client script, Any examples please, any help would be appropriated.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 11:12 PM
you can create UI Script and you can use it in different client script.
example:
UI script
function displaytitle()
{
var a= g_form.getValue('number');
var b= g_form.getValue('short_description');
if(a && b)
{
top.document.title= a +'-'+ b;
}
else
{
alert('hello');
}
}
client script
function onSubmit() {
displaytitle();
}
For more information refer the doc link below.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 11:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 11:21 PM
Thank you for your reply, just one concern if i want to call an on load client script in on submit or onchange how i can do that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 11:26 PM
if you see the above thread.
script has been used in
function onLoad() {
//Type appropriate comment here, and begin script below
}
var loadVariable = "test";
function loadOutisdeFunction(){
alert("Hello I am outside scope of OnLoad and I can be called from onChange");
}
now you have another client script. eg: onChange() or onSubmit()
you can recall like below script.
unction onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
alert(loadVariable); //I can reuse
loadOutisdeFunction(); // I can reuse
}
give a try.