If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Descriptions of javascript coding

Started by yogeswari, 22 May 2013 05:40:30 AM

Previous topic - Next topic

yogeswari

Hi,

The below sentence is the javascript code:

var theDiv = document.getElementById("menumber");
var node_list = theDiv.childNodes[0].getElementsByTagName("SELECT");
eleTg1Details = node_list[0].getElementsByTagName('OPTION');


I browsed and got infor like "getElementById" function retreives the Id of the element that we want to access and "getElemensByTagName" function retreives the Tagname of the element that we want to access.

What does ID and TagName means?Is it refers to Prompt ID and Name??If so how to set those properties in ReportStudio Cognos 10.1.

Moreover anyone give me full descriptions of the above 3 sentences.
Please help me.

thanks,
Yogeswari.

calson33

var theDiv = document.getElementById("menumber");

This is saying find the element on the page (an element is anything on a web page from textboxes to divs) with an ID of "menumber". Then put a pointer to that object into a variable called theDiv.

e.g. <div id="menumber">some text</div>

var node_list = theDiv.childNodes[0].getElementsByTagName("SELECT");

This finds all the elements within your object that are select boxes and puts a pointer into node_list. The childNodes[0] means look in the first set of nodes under thediv.


eleTg1Details = node_list[0].getElementsByTagName('OPTION');

This is getting the option list for the first select list found in the previous line.

If you are unfamiliar with select boxes and option lists then go here: http://www.w3schools.com/tags/tag_select.asp

yogeswari

Hi Calson,

First of all, Thanks for your reply.
The coding which i have asked is used in convertion from lowercase to uppercase.  I am attaching the coding in the document.  Please go through the document and explain me clearly.  Since i am new to this, i would like to know from the scratch.

i could not understand what logic they used because the title is "Validating the user entered text to convert them to uppercase.  There is no such object "_textEditBoxpromptname".

Please help me out this.

Thanks,
Yogeswari.

calson33

All that routine is doing is going through the options in a select list, and checking each character to see if it is uppercase.

This seems odd to me, since option lists tend to be generated dynamically rather than with user input.

Also, there is no reference to "_textEditBoxpromptname" anywhere in that code, so if you are seeing that error, it is happening in another javascript function.

yogeswari

Thanks for your reply.

Yes thats why i dont understand the logic used.  I know Javascript generally.
Since i am fresher to cognos i could not understand the cognos-javascript.

kindly provide one simple coding and explain me clearly pls.
I would like to learn it but could not understand it so only i am asking this :( :( :( :(.

Please help me.

Thanks,
Yogeswari.