how to check the value of object htmldivelement in ServiceNow javascript

vidyanandareddy
Tera Contributor

Hi Team,

 

I am trying to get the variable value in one record producer and I wrote a on change client script and I'm getting the responses as "Vidya alert:[object HTMLDivElement]"

 

vidyanandareddy_0-1730982648081.png

 

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@vidyanandareddy 

you are printing some variable which you have not defined

what are you trying to alert?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

 

I'm trying to get the value in subcategory, 

@vidyanandareddy 

then you should use name of variable and get the value

alert(g_form.getValue('variableName'));

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Gangadhar Ravi
Giga Sage
Giga Sage

Hi @vidyanandareddy 

 

You try this is onChange script. 

alert('vidya alert '+newValue);  

 Please mark my answer correct and helpful if this works for you.