how can i send 2 parameters from GlideAjax.I have written the code but doesn't seems to be working.

Priya75
Tera Contributor

Hi All,

 

I want to pass two parameters from client side to server side (script Include), I am using change client script and sending data to the script include.

 

var ga=new GlideAjax("script_Include_name");

ga.addParam("sysparam_name", "function name");

ga.addParam("sysparam_user_name", g_from.getValue("start_date");

ga.addParam("sysparam_user_name2", g_from.getuniqueValue());

ga.xml(callback);

 

Script Include:-

var date=this.getParameter("sysparam_user_name");

var sys_id=this.getParameter("sysparam_user_name2");

 

I am also printing it in logs, i am getting only one value.

 

4 REPLIES 4

Sandeep Rajput
Tera Patron
Tera Patron

@Priya75 Update your code in client script as follows.

var ga=new GlideAjax("script_Include_name");

ga.addParam("sysparam_name", "function name");

ga.addParam("sysparam_user_name", g_form.getValue("start_date"));

ga.addParam("sysparam_user_name2", g_form.getUniqueValue());

ga.getXML(callback);

 

Hope this helps.

 

 

Ahmmed Ali
Mega Sage

Hello @Priya75 

 

g_form is misspelt in your code, it should be g_form.getValue() and g_form.getUniqueValue(). 

 

If this does not solve the issue, please post your entire script.

 

Thanks,

Ali

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

These all things are fine, i have misspelt it here. But my issue is that i can only pass one value and other one is coming as null. 

Can you post screenshot of both script include and client script here? without those, it will be difficult to debug.

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali