Jelly scripting

surya123
Mega Guru

Hi All,

I have a textbox in portal. The user will input the value in textbox and click on Submit.

On Submit, I want to write a jelly script so that it compares the data input by user in textbox with the data base table to see if it matches and if so, it returns a field value.

Eg : If a user enters k001 in the textbox in portal, the script should match this k001 with the list of records in table xyz and if it finds a match it outputs a fields (abc) value.

Thanks in advance

surya

6 REPLIES 6

timmyweytjens
Tera Expert

Hello Surya,



You can use a GlideAjax call in the onclick javascript for your button to get the data on the server and then process the response as you wish.



Regards,


Timmy


Hi Timmy


I have placed the button as dynamic content to place it in portal.


I am not sure how I can use GlideAjax in this case.


timmyweytjens
Tera Expert

Can you show what you have in your dynamic content block for your page?


Hi Timmy



This is the dynamic content.


<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">



  <input id="name" spellcheck="false"


maxlength="32" style="direction:ltr; " name="name"


onchange="onChange('name');"


  value="${name}" class="form-control" autocomplete="off" type="text" />


   


  <button class="button" style="vertical-align:middle;font-weight:bold;color:black" onclick="location.href='https://your.service-now.com/Xyz/Abc.do'" type="button"><span>Submit</span></button>


</j:jelly>