How to call UI script in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 06:12 PM
I created a simple ui script, as mentioned below. How can I call this from client 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');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 07:52 PM
So this is the client script I wrote
function onSubmit() {
var ab= new display_title();//name of the ui script
ab.displaytitle();
}
But its giving error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 08:04 PM
You can directly call with function name in client script
For Example:
function onLoad(){
displaytitle(); //Calling ui script function
}
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 08:15 PM
This is my 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');
}
}
and as suggested I made these changes in client script
function onSubmit() {
displaytitle();
}
and it doenot do anything
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 08:22 PM
Hi Sunny,
I have checked with the same script in my system and it is working fine for me
1. UI script must be made Global (Global check box must be checked true).
2. After that we can call the ui script by the function name.
Thanks!
NOTE : UI Script must be GLOBAL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2016 08:23 PM
Can you share Screenshots of both the scripts from the top which should include all the variables on the form like name of the script table