473,511 Members | 16,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hi, what kind of script is this, i've been working in workflow and got a little codin

2 New Member
Expand|Select|Wrap|Line Numbers
  1. var g_cat_form = null;
  2. function onLoad() {
  3.  
  4.   var cat = g_form.getValue('sys_display.original.sc_req_item.cat_item');
  5.   if (cat != 'Blackberry')
  6.      return;
  7.  
  8.   var map = gel('variable_map');
  9.   var cat_form = new ServiceCatalogForm('ni', true, true);
  10.  
  11.   var items = map.getElementsByTagName("item");
  12.   for (var i = 0; i < items.length; i++) {
  13.      var item = items.item(i); 
  14.      var id = item.id;
  15.         var name = item.getAttribute('qname');
  16.         optionId = getItemOptionID(id);
  17.         var nm = new NameMapEntry(name, "ni.VE" + optionId);
  18.         cat_form.addNameMapEntry(nm);
  19.   }
  20.  
  21.   var replacement = cat_form.getControl('replacement');
  22.   if (!replacement)
  23.     return;
  24.  
  25.   var original = cat_form.getControl('original');
  26.   if (!original)
  27.     return;
  28.  
  29.   g_cat_form = cat_form;
  30.   setReasonVisibility(null, replacement);
  31.   var els = document.getElementsByName(replacement.name);
  32.   for (var i = 0; i < els.length; i++)
  33.     els[i].onclick = setReasonVisibility.bindAsEventListener(els[i]);
  34. }
  35.  
  36. function getItemOptionID(id) {
  37.   var item_option = new GlideRecord('sc_item_option_mtom');
  38.   item_option.addQuery('request_item', g_form.getUniqueValue());
  39.   item_option.addQuery('sc_item_option.item_option_new', id);
  40.   item_option.query();
  41.   if(item_option.next())
  42.       return item_option.sc_item_option;
  43. }
  44.  
  45. function setReasonVisibility(e, target) {
  46.    jslog('setReasonVisibility');
  47.    if (!e)
  48.       e = window.event;
  49.  
  50.    if (!target)    
  51.       target = e.target ? e.target : e.srcElement;
  52.  
  53.    var vis = false;
  54.    if (target.value == 'Yes')
  55.      vis = true;
  56.  
  57.    g_cat_form.setDisplay('original', vis);
  58. }
Mar 12 '15 #1
2 1539
chaarmann
785 Recognized Expert Contributor
it is javascript. I guess server-side, because of the "jslog" function that seems to write into a log.
Mar 20 '15 #2
bongskie36
2 New Member
Okay chaarmann, thank you for your reply
Mar 23 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
6520
by: pantagruel | last post by:
The following does not work in firefox: <script defer="defer"> var x=document.getElementsByName("repositoryNamespace") alert(x.length + " elements!")
3
1526
by: Raymond | last post by:
Hello folks, My script is as below: parent.menu.location.reload(true); parent.frames("menu").TreeView1.CollapseAll(); parent.frames("menu").TreeView1.SelectNodeById(id);...
0
1103
by: aBs0lut30 | last post by:
Hi Guys, I am working on a site and recently added several client callbacks to the project. Everything works GREAT while debugging the site in visual studio. Last night I copied the site up to our...
7
2556
by: anushhprabu | last post by:
#define q(k)main(){ return!puts(#k"\nPRABUq("#k")");} q(#define q(k)main(){return!puts(#k"\nq("#k")");}) guys i'm working on this code.. i got it fromnet.. how this is working.. anyone pls.....
10
2196
by: =?ISO-8859-1?Q?Fran=E7oise_Debat?= | last post by:
Hello, I wonder if anybody can help. I have an IP blocking script which displays a blank screen if an IP is detected from a list in an external file. The problem is, the script only reads the...
5
6576
by: CoolForU | last post by:
this is my code and i call this code from code behinde file on page load like this useragree.Attributes.Add("onclick", "CheckSelection();") this is working fine with IE but not working with...
16
1493
by: shapper | last post by:
Hello, I have the following classes: namespace MyApp.Models { public class Tie { public Count Count { get; set; } public Tie() { this.Count = new Count(); }
1
1421
by: pandharinath | last post by:
I want to display fields(row) selected from grid in popup window to textboxes in Opener window. I have written code as follows : Main Opener window protected void Button1_Click(object...
3
1476
by: mark roldan | last post by:
Hi, this is a code for form verification... I added the function results() then the entire script is now not working. Need help... *note that if I omit the results() function, other functional parts...
1
1555
by: ranjeeeet | last post by:
my image upload script is not working while insert script is working
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7423
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5066
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.