You are viewing limited content. For full access, please sign in.

Question

Question

jquery getscript not working

asked on March 13, 2017

Hi All,

I am creating a form which needs to update information in database before submitting. So i thought of creating a javascript file outside and using jquery getscript function im calling that file to execute database update.

For testing : 

I have created a testapi.js file 

function popup() {
alert("Hello World")
}

and dropped this file where i hosted laserfiche forms. (http://IPADDRESS/Forms/Scripts/testapi.js)

 

In javascript editor of the form, i'm calling this function popup() on a button click as in the screenshot but nothing happens.

 

Please help me to resolve this.. 

Thanks in advance

 

 

getscript.png
0 0

Replies

replied on March 14, 2017

Please try following:

$(document).ready(function () {
  $('#q543 input').on('click',clear);
  function clear()
  {
    $.getScript("http://xxx/forms/Scripts/testapi.js",function(){
      popup();
    });
    alert("HI");
  }
});

 

0 0
replied on March 14, 2017

Hi Xiuhong,

Thanks a lot . I tried and it worked. 

I have one more doubt, from this popup() function can i do all database activity ??

0 0
replied on March 14, 2017

You should be able to that.

0 0
replied on March 14, 2017

Thank you Xiuhong..

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.