Counting xml elements using javascript
How can I count the number of certain xml elements inside the xml file that import.
Example xml:
<list>
<product>
<name>Product_01</name>
<detail>info here</detail>
</product>
<product>
<name>Product_02</name>
<detail>info here</detail>
</product>
<product>
<name>Product_03</name>
<detail>info here</detail>
</product>
</list>
I would like to count the number of product -elements in this example xml.
I'm using javascript for scripting.
Thanks.
#target indesign
#include "/Applications/Adobe InDesign CS3/Scripts/Xml Rules/glue code.jsx"
var myDocument = app.activeDocument;
var myCounter = 0;
var myRuleSet = new Array (new ProcessProduct);
with(myDocument){
var elements = xmlElements;
__processRuleSet(elements.item(0), myRuleSet);
alert("Found " + myCounter + " product elements");
function ProcessProduct(){
this.name = "ProcessProduct";
this.xpath = "//product";
this.apply = function(myElement, myRuleProcessor){
with(myElement){
myCounter++;
return true;
Similar Messages
-
Lock/Disabled/Readonly Element using Javascript
hi,
how to lock or disabled or make readonly element using javascript in APEX 3.2
i need to lock/readonly popup element in the form
CAN ANYONE HELP ME?A little complex, so possibly there will be a simpler solution than this.
Immediately following the readOnly statement enter this code
$x('P60_NAME').readOnly="readOnly";
latag = $x('P60_NAME_holder').getElementsByTagName('A');
for (i=0;i < latag.length; i++){
latag.removeAttribute('href');
This code removes the HREF attributes from the Image anchor.
This should fix it.
Regards, -
Rename an XML tag using javascript
Dear adobe experts,
I have a requirement to rename XML tags, in the interface for an adobe form, using javascript.
the XML looks like this:
<ELEMENT>
<DATA>
<ROW_IID>0</ROW_IID>
<PARENT>0</PARENT>
<CHILD>0</CHILD>
</DATA>
<DATA>
<ROW_IID>1</ROW_IID>
<PARENT>0</PARENT>
<CHILD>0</CHILD>
</DATA>
</ELEMENT>
and the result should look something like this:
<ELEMENT>
<CHAIR>
<ROW_IID>0</ROW_IID>
<PARENT>0</PARENT>
<CHILD>0</CHILD>
</CHAIR>
<TABLE>
<ROW_IID>0</ROW_IID>
<PARENT>0</PARENT>
<CHILD>0</CHILD>
</TABLE>
</ELEMENT>
Is this possible and how can I do this? I was hoping that something like renameNode() (for instance) is also possible in the javascript set for adobe forms.
If it's not possible I'm going to have to create new nodes, put the data from the existing node in the new node and remove the original node. This will be a lot more work and just renaming is easier :-).
Kind regards,
NielsHi,
Thanks a lot Jeff...
I'm doing a huge program with lot of tasks. While doing that,my mind didn't strike to check if the tag is not already exist, then only to create new tag... Thanks for all of the indesigner experts for their replies...
I used the following codes with ur idea.
var renamewith = textbox1.text;
try
alert(app.activeDocument.xmlTags.item(renamewith).name);
if(app.activeDocument.xmlTags.item(renamewith).name)
var testTag = app.activeDocument.xmlTags.item(renamewith);
catch(e)
var testTag = app.activeDocument.xmlTags.add({name: renamewith});
With Regards,
Vel. -
Dynamically validating datatable elements using javascript
Hai, iam using jsf, and having Xml mapping to the form elements to display the data . Iam using <h:datatable> inside which iam haveing repeated elements, i need to do a javascript validation before displaying the form element present inside the <h:datatable> columns.Iam also using <j4j:idproxy> , the java script is working for 1 iteration but it is the dataof the form element is not getting overridden in the 2nd iteration, It is somethinglike this below.
<TR id="buiCoverRowId" style="display:none;">
<TD height="9" width="200"></f:verbatim> <h:outputText
styleClass="outputText" id="text7"
value="Buildings Cover"></h:outputText><f:verbatim></TD>
<TD height="9" width="516"></f:verbatim> <h:outputText
styleClass="outputText" id="buildCoverId"
value="#{pathPart.xpathMap['./BuildingsCover/CoverDetail/SumInsured/Amount']}">
</h:outputText> <f:verbatim></TD>
</TR>
<TR>
<TD></f:verbatim><f:verbatim>
<h:inputHidden id="hidBuiCoverId"
value="#{pathPart.xpathMap['./BuildingsCover/CoverDetail/SumInsured/Amount']}">
<j4j:idProxy id="hidBuiCoverId_" />
</h:inputHidden>
</f:verbatim><f:verbatim></TD>
<TD></f:verbatim><f:verbatim>
<h:inputHidden id="hidExBuiCoverId"
value="#{pathPart.xpathMap['./BuildingsCover/ExcludedInd/Value']}">
<j4j:idProxy id="hidExBuiCoverId_" />
</h:inputHidden>
</f:verbatim><f:verbatim></TD>
</TR>
<SCRIPT>
alert("HAI");
var buidcover = document.getElementById('hidExBuiCoverId_').title;
var buidcoverR =document.getElementById(buidcover).value;
alert("the value of buildcover----->"+buidcoverR);
var buId =document.getElementById('hidBuiCoverId_').title;
var entitybuId1 = document.getElementById(buId).value;
entitybuIdT1 = trim(entitybuId1);
alert("entitybuIdT1"+entitybuIdT1);
var buExId = document.getElementById('hidExBuiCoverId_').title;
var entitybuExId1 = document.getElementById(buExId).value;
entitybuExIdT1 = trim(entitybuExId1);
entitybuExIdU1 = entitybuExIdT1.toUpperCase();
alert("entitybuExIdU1"+entitybuExIdU1);
if(!(entitybuIdT1 == null || entitybuIdT1 == '') && ((entitybuIdT1 == "0")) && (entitybuExIdU1 == 'FALSE'))
document.getElementById("buiCoverRowId").style.display="block";
</SCRIPT>
The form element is mapped to the xml. the above code is written within a datatable, iam using javascrpt within this to display the datat or not, it is working for first iteration but its not working for second iteration. Plz help me with this . Is there any way that i can use javascript so that it vvalidates the form elements even for the 2 iteration of the datattable. I am having thesame values (of the 1iteration) even during the 2 iteration. Plz help me with this asap.Got the solution.
$("div.ms-acal-rootdiv div div div a").html().replace('Replace this text only.','Replaced Text'); -
Import xml/xsl using javascript
I had problem in import a xml file with xsl using javascript. CS3 only take the elements in xml without any xsl information when I defined doc.xmlImportPreferences.transformFilename="c:\\sample.xsl"; What else do I need to define to allow CS3 know that my xsl file is sample.xsl.
By the way, after I maunually import them, it can be handled by the program. I wonder there must be something missing when I try to import it viw Javascript at first time.
-
Hi
I am following below link to hide/show my columns dynamically. See "Column Formatting"
http://docs.oracle.com/cd/E12844_01/doc/bip.1013/e12187.pdf
As per doc, element can be made private/public.
<items type="PUBLIC">
<item>
<name>Plasma TV</name>
<quantity>10</quantity>
<price>4000</price>
</item>
<item>
And same can be used to hide the column using condition
<?if@column:/items/@type="PUBLIC"?>
MY QUESTION IS HOW TO DO THIS IN MY XML BELOW?
Below is part of my XML code which I am using in Data Definition for RTF.
<group name="GH3" source="QH3">
<element name="COLUMN_HEAD3" value="COLUMN_NAME" />
</group>
<group name="GH4" source="QH4">
<element name="COLUMN_HEAD4" value="COLUMN_NAME" />
</group>
I am getting output like this.
<LIST_GH3>
<GH3>
<COLUMN_HEAD3>REBILL_TO_OTHER_BUSINESS_UNIT</COLUMN_HEAD3>
</GH3>
</LIST_GH3>
<LIST_GH4>
<GH4>
<COLUMN_HEAD4>XYZ</COLUMN_HEAD4>
</GH4>
</LIST_GH4>
In order to use logic as per oracle document I want output like this.
<LIST_GH3 type="PUBLIC">
<GH3>
<COLUMN_HEAD3>REBILL_TO_OTHER_BUSINESS_UNIT</COLUMN_HEAD3>
</GH3>
</LIST_GH3>
<LIST_GH4 type="PRIVATE">
<GH4>
<COLUMN_HEAD4>BLANK</COLUMN_HEAD4>
</GH4>
</LIST_GH4>
What changes I need to make in my XML code to get the runtime output as above? Please help. Where do i need to make changes in the above xml? Group name? Element name?
I am planning to use below condition in RTF template to hide the column, but dont know how to set the type of column as PRIVATE/PUBLIC in the XML output used to populate data in the RTF at runtime.
<?if@column:/BTSPIEXP/LIST_GH3/@type=”PUBLIC”?>COLUMN_HEAD3<?end if?>
Regards,
Swapnil K.Hi,
Issue has been resolved. I used the value of the element to determine to display it or not.
Regards,
Swapnil K. -
How to iterate xml elements using PL/SQL
Hello,
Let's say I have the following xml:
<A>
<B name="b1">
</B>
<B name="b2">
</B>
</A>
I would like to iterate over the B and sub-B elements using PL/SQL?
Any help will be appreciated.Hi,
You can use 'PL/SQL DOM API for XMLType (DBMS_XMLDOM)'
to work with XML. You can check the example present at
http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96620/xdb08pls.htm#1041419
to check how it does.
The API for the package DBMS_XMLDOM is given on the same page(http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96620/xdb08pls.htm#1040676)
You can use them for your requirement.
Regards,
Anupama -
How to modify the content of a xml element using java?
Hi all,
In my usecase I need to export some data from the database to the external file (Ms Word) using java.
The data which I get from the database will be in the form of a xml file. In that xml file
I got to modify the content of an attribute of a xml element in the java class. Kindly comeup with your help
to achieve this.
Thanks,
Phanindra.
Edited by: 887737 on Dec 5, 2011 5:52 AMWhy don't you try Xerces2?Why don't you tell him to use the javax.xml APIs that are already built in? And that use Xerces2 under the hood? Instead of throwing out a suggestion that might lead to him adding another copy of Xerces into his application?
@OP there are several techniques:
- string replacement as suggested by jschell
- XML parsing to a DOM and then use the DOM API
- XSLT
Which you should use depends on the complexity of your requirement. -
Remove xml element using JS[CS3]
Hi, I have an xml structure where i want to remove some paritcular element named "extlink".
I do have one script with me but it doesn't wipe out all specific xml element from structure.
var myDoc = app.activeDocument;
var foundtext = 0
Query_Remove (myDoc);
alert ("You have removed " + foundtext + " " +" Link !!")
exit (0);
function Query_Remove(elm)
try
for(var i=elm.xmlElements.length-1; i>=0; i--)
if((elm.xmlElements[i].markupTag.name == "extlink") && (elm.xmlElements[i].xmlElements[0].markupTag.name == "http"))
var Store_CitAttri = elm.xmlElements[i].xmlElements[0].xmlAttributes.item("c_style").value;
if(Store_CitAttri == "URL")
elm.xmlElements[i].remove();
foundtext = foundtext + 1;
Query_Remove(elm.xmlElements[i]);
catch (e){
Some time it skip the element from all figure captions and some time from body text and some time it works perfectly
Could any one figure it out why this script behaviour is not consistent as i am new to scripting and not getting any idea about this.
Thanks
MacOkay, after peering over your code and trying a few things out I see one immediate problem and one possible improvement.
The problem lies in this:
1. if condition is true, remove item
2. check recursively
The problem is .. if an item is removed, the following recursive check will always fail. However, the entire loop is wrapped into a try..catch, so InDesign will not alert you that it failed. Instead, it will continue with what's after the loop, exactly because the try..catch is around the entire loop!
Change the loop code to this
if((elm.xmlElements[i].markupTag.name == "http") && (elm.xmlElements[i].parent.markupTag.name == "extlink"))
var Store_CitAttri = elm.xmlElements[i].xmlAttributes.item("c_style").value;
if(Store_CitAttri == "URL")
elm.xmlElements[i].remove();
foundtext = foundtext + 1;
continue;
Query_Remove(elm.xmlElements[i]);
so the recursive checking is skipped. You can also remove the entire try..catch block, as this may hide additional errors ...
The improvement is: as I started reading this thread from the top again, shouldn't you be removing the "extlink" items, rather than just the "http" ones inside?
If so, remove the parent of the found item (which is always the "extlink"):
elm.xmlElements[i].parent.remove();
-- and, as this will break the loop (because you just removed the set of elements it was working in!), replace 'continue' with 'return'.
Hope this helps -
Edit / Modify an XML Element using SAX.
My need is to read,update,delete elements from large (200-700MB) xml files. Because of large files I am using SAX parser. I am able to read the xml using events generated but the issue is how do I modify a perticular attribute or node value, add new node??
Apart from SAX is there any other better solution???
Any help wil be appreciated!!if you meant "in a simple and quick way that will only change the desired value in the text file" i fear no, you can't
-
Formatting of query returning multiple xml elements using xmlattributes
Hi, i've been tasked with producing output, based on an XSD, with repeating elements defined using distinct attributes related to the element. I've managed to get this working, but would like to make the solutions code more elegant than it is at the moment, and was wondering if anyone may be able to give me a hand with this?
Firstly, database details
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
"CORE 11.2.0.2.0 Production"
TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - ProductionAn example of the output i'm expecting is as follows
<financials>
<depositDate INVITE_PACK="Current">2011-12-01</depositDate>
<depositDate INVITE_PACK="Alternate">2011-12-01</depositDate>
<deposit INVITE_PACK="Current">19.88</deposit>
<deposit INVITE_PACK="Alternate">20.65</deposit>
<basicPremium INVITE_PACK="Current">198.76</basicPremium>
<basicPremium INVITE_PACK="Alternate">206.49</basicPremium>
</financials>This data is held in a relational database table and i'm currently gernerating the data from this relational table using something similar to the following:
SELECT xmlagg
(xmlelement("financials",
(select xmlagg(xmlelement("depositDate",
xmlattributes(fi1.quote),
fi1.DEPOSIT_DATE
)) as "depDt_det"
FROM (select distinct f1.fulfilment_queue_key,
f1.fq_policy,
f1.quote,
f1.deposit_date
from staging.fulfilment_xml_finance_inv1 f1) fi1
WHERE fi1.fulfilment_queue_key = fi.fulfilment_queue_key),
(select xmlagg(xmlelement("deposit",
xmlattributes(fi1.quote),
fi1.PPD_DEPOSIT)) as "dep_det"
FROM (select distinct f1.fulfilment_queue_key,
f1.fq_policy,
f1.quote,
f1.PPD_DEPOSIT
from staging.fulfilment_xml_finance_inv1 f1) fi1
WHERE fi1.fulfilment_queue_key = fi.fulfilment_queue_key),
(select xmlagg(xmlelement("basicPremium",
xmlattributes(fi1.quote),
fi1.BASIC_PREM)) as "bprem_det"
FROM (select distinct f1.fulfilment_queue_key,
f1.fq_policy,
f1.quote,
f1.basic_prem
from staging.fulfilment_xml_finance_inv1 f1) fi1
WHERE fi1.fulfilment_queue_key = fi.fulfilment_queue_key)
FROM staging.fulfilment_xml_finance_inv1 fi
WHERE fi.fulfilment_queue_key = 2861
AND rownum = 1As can be seen, i'm replicating a number of calls to the fulfilment_xml_finance_inv1 table. I was wondering if there is a way to do the above in a more succinct, supportable and readable fashion? I have a tried a number of differnt methods to do this, but can't seem to get it to work for me. Any ideas would be greatly appreciated.
Thanks.Hi again,
No problem, create table statement
-- Create table
create table FULFILMENT_XML_FINANCE_INV1
fulfilment_queue_key NUMBER(22),
fq_policy VARCHAR2(50),
riskversion NUMBER(28,7),
basic_prem NUMBER(10,2),
os_balance NUMBER(10,2),
ppd_deposit NUMBER(10,2),
ppd_plan_charge NUMBER(10,2),
ppd_charge_for_interest NUMBER(10,2),
ppd_apr_perc NUMBER(10,2),
ppd_interest NUMBER(22,6),
inst_freq VARCHAR2(1),
deposit_date DATE,
adj_premium NUMBER(19,2),
order1 NUMBER(38),
amountdue NUMBER(28,7),
collection_date DATE,
paymentduedate DATE,
scharges NUMBER(19,2),
ppd_plan_collection_reference VARCHAR2(20),
reapply_date DATE,
reapply_amount NUMBER(19,2),
last_inst_freq VARCHAR2(1),
quote VARCHAR2(10)
);example inserts
insert into fulfilment_xml_finance_inv1
(fulfilment_queue_key,
fq_policy,
riskversion,
basic_prem,
os_balance,
ppd_deposit,
ppd_plan_charge,
ppd_charge_for_interest,
ppd_apr_perc,
ppd_interest,
inst_freq,
deposit_date,
adj_premium,
order1,
amountdue,
collection_date,
paymentduedate,
scharges,
ppd_plan_collection_reference,
reapply_date,
reapply_amount,
last_inst_freq,
quote)
values
(2861,
'TEST1234',
3,
198.76,
123.45,
19.88,
0,
99.99,
99.99,
55.55,
'A',
to_date('01/12/2011','dd/mm/yyyy'),
null,
NULL,
NULL,
NULL,
null,
0.00,
'N/A',
NULL,
NULL,
'A',
'Current')
insert into fulfilment_xml_finance_inv1
(fulfilment_queue_key,
fq_policy,
riskversion,
basic_prem,
os_balance,
ppd_deposit,
ppd_plan_charge,
ppd_charge_for_interest,
ppd_apr_perc,
ppd_interest,
inst_freq,
deposit_date,
adj_premium,
order1,
amountdue,
collection_date,
paymentduedate,
scharges,
ppd_plan_collection_reference,
reapply_date,
reapply_amount,
last_inst_freq,
quote)
values
(2861,
'TEST1234',
3,
206.49,
123.45,
20.65,
0,
99.99,
99.99,
55.55,
'A',
to_date('01/12/2011','dd/mm/yyyy'),
null,
NULL,
NULL,
NULL,
null,
0.00,
'N/A',
NULL,
NULL,
'A',
'Alternate') Hope this is what you were after, please let me know if you need anything else.
Thanks again. -
Help with counting XML elements and converting from MS SQL 2008 to ORACLE
Hello,
My ORACLE DB version is:
('Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production');
('PL/SQL Release 11.2.0.2.0 - Production');
('CORE 11.2.0.2.0 Production');
('TNS for Linux: Version 11.2.0.2.0 - Production');
('NLSRTL Version 11.2.0.2.0 - Production');
I'm trying to convert the below SQL Server 2008 query to work on Oracle. It's important to note that the XMLData column type is CLOB.
Query 1)
-- Number of validations
select br.rulename, CAST(( CAST(br.XMLData as XML)).query('count(//Validation/Expressions/Expression)') as nvarchar(50)) as "Number of //Validation/Expressions/Expression"
from AsBusinessRules br
where
DATALENGTH(br.XMLData)>10
and CAST(( CAST(br.XMLData as XML)).query('count(//Validation/Expressions/Expression)') as nvarchar(50)) not like '0'
Any help is greatly appreciated.Hi,
You can try one of these :
select br.rulename
, count(*) as "Num. of Expression"
from AsBusinessRules br
, xmltable(
'//Validation/Expressions/Expression'
passing xmltype(br.XMLData)
) x
where length(br.XMLData) > 10
group by br.rulename
having count(*) != 0
;or,
select br.rulename
, xmlcast(
xmlquery(
'count(//Validation/Expressions/Expression)'
passing xmltype(br.XMLData)
returning content
as number
) as "Num. of Expression"
from AsBusinessRules br
where length(br.XMLData) > 10
and xmlcast(
xmlquery(
'count(//Validation/Expressions/Expression)'
passing xmltype(br.XMLData)
returning content
as number
) != 0
It's important to note that the XMLData column type is CLOB.Could you consider migrating the column to XMLType datatype?
Given your version, it would be binary XML by default and therefore a lot more performant with XQueries, compared to a simple CLOB storage. -
How to replace XML elements using java
I have been usint SAX 2.0 and DOM Level 2 api's to represent XML documents, which i parse with apache's Xerces parser... I am trying to delete certain elements and replace them with others, but none of the api's allow this the closes i have come is replacing attributes of elements....
Answered in crosspost.
http://forum.java.sun.com/thread.jspa?threadID=638156 -
Getting error in Mozilla, reading xml using JavaScript
Hi All,
I am working with javascript with xml, getting error in Mozilla
1. see html and xml file and check xml file path before test ---
2. please, go through the html and xml file.
read_xml.html
=================
<html>
<head>
<title>xml file using javascript</title>
<script type="text/javascript">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
//loading xml file
function doLoadXML(xmlFile)
xmlDoc.async="false";
xmlDoc.onreadystatechange=doStateVerify;
xmlDoc.load(xmlFile);
rootData=xmlDoc.documentElement;
function doStateVerify()
if (xmlDoc.readyState != 4)
return false;
// reading xml file
function doReadXML()
alert("calling function");
doLoadXML("C:/Documents and Settings/webdeveloper06/Desktop/for_test/comp-info.xml");
alert("loading file...........");
var dataArr=new Array();
dataArr=xmlDoc.getElementsByTagName("comp-info");
for(var m=0; m <= dataArr.length-1; m++)
alert("entering inside looping here");
document.write("<Table border='1px'><tr><td>");
document.write(dataArr[m].getElementsByTagName("name")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("description")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("web-addr")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("address")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("city")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("postal-code")[0].firstChild.nodeValue);
document.write(dataArr[m].getElementsByTagName("country")[0].firstChild.nodeValue);
document.write("</input></td></tr></table>");
</script>
</head>
<body>
<input type="button" value="Display XML Data" onClick="doReadXML()" />
</body>
</html>
com-info.xml
=========
<?xml version="1.0" encoding="iso-8859-1"?>
<itcopany>
<comp-info>
<name>xxx</name>
<description>IT Reaserch Company</description>
<web-addr>http://xxx.com</web-addr>
<address>mehdipatnam</address>
<city>Hyderabad</city>
<postal-code>777888888</postal-code>
<country>IN</country>
</comp-info>
<comp-info>
<name>yyyyy </name>
<description>Non IT Company</description>
<web-addr>http://yyyy.com</web-addr>
<address>xyxxyxyx</address>
<city>Banglore</city>
<postal-code>78878787878</postal-code>
<country>IN</country>
</comp-info>
<comp-info>
<name>zzzzzzz</name>
<description>IT Company</description>
<web-addr>http://zzzzzzz.com</web-addr>
<address>secondrabad</address>
<city>Hyderabad</city>
<postal-code>9999999999999</postal-code>
<country>IN</country>
</comp-info>
</itcopany>
output status
============
1. getting output in IE
2. not getting output in Mozilla
Can anyone Helpout, To get data in Mozilla
regards,
AbuTry to check this document Browser Support for SAP and use PAM (Product Availability Matrix) to check for the compatibility of your SAP system with the browser.
If you are only the user of the Web Dynpro you would have probably no other choice than change the browser. -
How to set a form element value using javascript?
Hello,
I have been using the following two functions in AS 9.0.2 to set form values in javascript and it works correctly. However, the same code does not work in AS 10.1.2.0.2. Would appreciate if someone could let me know how to set form elements using Javascript(onchange of a field).
function set_item_value(p_field_name, p_value)
var v_index, v_full_name;
for(v_index=0; v_index<document.forms[0].length; v_index++)
v_full_name = document.forms[0].elements[v_index].name.split
if (v_full_name[2] == p_field_name)
document.forms[0].elements[v_index].value = p_value;
function get_item_value(p_field_name)
var v_index, v_full_name, v_return="";
for(v_index=0; v_index<document.forms[0].length; v_index++)
v_full_name = document.forms[0].elements[v_index].name.split
if(v_full_name[2] == p_field_name)
if(document.forms[0].elements[v_index].type != "radio")
v_return = document.forms[0].elements[v_index].value;
else
if(document.forms[0].elements[v_index].checked)
v_return = document.forms[0].elements[v_index].value;
if(v_return == " ")
v_return = "";
return v_return;
Thanks
DevThis is not the best way to write JavaScript in Portal environment!
You can't be sure that a form is the first in the html source!
In Portal you change the order of your portlets, and also you can have several instances of the same portlet on the same page!!!
You should use qualified form and field names!
Please check the following JPDK methods:
UrlUtils.htmlFormName
HttpPortletRendererUtil.portletParameter
Maybe you are looking for
-
Can I use my airport to see how many devices are on my network?
Can I use my airport to see how many devices are on my network?
-
Wife's iPhone email address bug -- HELP!
Something odd has been happening on my wife's iOS 5 iPhone 4. She compose an email and where her address is supposed to show (as the person sending the email) instead stands someone else's email address. Said address is in her Contacts app, and whe
-
Hello, sometimes when I open up mail messages or web pages I get little blue boxes with question marks where there should be images? What am I doing wrong? Is there a setting I'm missing? Thanks!!
-
Can we use ad hoc query to get a temporary report of payroll result?
Hi,All can we use ad hoc query to get a temporary report of payroll result?or we have to get a report of payroll result by customizing and ABAP? and how can I customizing a report on the basis of standard SAP report for payroll?
-
Captivate 4: linked pdf file opens when published but closes project
I have linked a couple of pdf files (Live Cycle) to an Adobe Cap 4 project. When I published the Captivate file the pdf file opens and works well but once the user closes the pdf file to contine to the next slide the project closes. Does anyone kn