You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by magic <ma...@soho.club.tw> on 2004/08/20 08:15:50 UTC

how to get nodevalue in javascript

hi, everyone

        When I wrote "var a1 =
document.getFirstChild().getChildNodes().item(1).getNodeValue();", a1 =
null.  How can I get nodevalue in javascript? Someone help me? Thanks!

function obm1(form) {
     var documentURI = cocoon.parameters["documentURI"];
     var document = loadDocument(documentURI);

     // bind the document data to the form
     form.load(document);

 var wid=form.lookupWidget();
 wid.obm1_date.value=new java.util.Date();
 wid.obm2List[0].obm2_part.value =
document.getFirstChild().getChildNodes().item(1).getNodeName();
 wid.obm2List[1].obm2_part.value =
document.getFirstChild().getChildNodes().item(1).getNodeValue();

 form.showForm("obm1-display-pipeline");
 }

Magic


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: how to get nodevalue in javascript

Posted by magic <ma...@soho.club.tw>.
Sorry, I miss "getFirstChild()". When I wrote "var a1 =
document.getFirstChild().getChildNodes().item(1).getFirstChild().getNodeValu
e();", it works.
----- Original Message ----- 
From: "magic" <ma...@soho.club.tw>
To: <us...@cocoon.apache.org>
Sent: Friday, August 20, 2004 2:15 PM
Subject: how to get nodevalue in javascript


> hi, everyone
>
>         When I wrote "var a1 =
> document.getFirstChild().getChildNodes().item(1).getNodeValue();", a1 =
> null.  How can I get nodevalue in javascript? Someone help me? Thanks!
>
> function obm1(form) {
>      var documentURI = cocoon.parameters["documentURI"];
>      var document = loadDocument(documentURI);
>
>      // bind the document data to the form
>      form.load(document);
>
>  var wid=form.lookupWidget();
>  wid.obm1_date.value=new java.util.Date();
>  wid.obm2List[0].obm2_part.value =
> document.getFirstChild().getChildNodes().item(1).getNodeName();
>  wid.obm2List[1].obm2_part.value =
> document.getFirstChild().getChildNodes().item(1).getNodeValue();
>
>  form.showForm("obm1-display-pipeline");
>  }
>
> Magic
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org