Re: Flowscript - amend file - Solved

2006-03-31 Thread Peter Sparkes

I have solved the problem

doc is the document, appendChild is a method of the node object so have 
to use


doc.documentElement.appendChild(lodgeEl);

where documentElement returns the element node of the doc

Peter Sparkes


Hi,

I am using CForms to generate and store files on the server. I want to 
take some of the entered data and use it to amend a different file 
stored on the server. Within the CForm javascript I extract the data 
from the form using


var lodge= form.getChild(name).getValue();

I then load the file which I wish to amend with

var doc = loadDocument(test.xml);

find the element which I wish to amend with

doc.getElementById('a')

save the doc with

saveDocument(doc, 'test1.xml');

All this works fine, but when I try append the data to the file with

doc.getElementById('a').appendChild(doc.createTextNode(lodge));

I get the following error

org.mozilla.javascript.EcmaError: Cannot convert null to an object.

Please can anyone tell me what I am doing wrong.

Peter Sparkes


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Flowscript - amend file

2006-03-30 Thread Peter Sparkes

Hi,

I am using CForms to generate and store files on the server. I want to 
take some of the entered data and use it to amend a different file 
stored on the server. Within the CForm javascript I extract the data 
from the form using


var lodge= form.getChild(name).getValue();

I then load the file which I wish to amend with

var doc = loadDocument(test.xml);

find the element which I wish to amend with

doc.getElementById('a')

save the doc with

saveDocument(doc, 'test1.xml');

All this works fine, but when I try append the data to the file with

doc.getElementById('a').appendChild(doc.createTextNode(lodge));

I get the following error

org.mozilla.javascript.EcmaError: Cannot convert null to an object.

Please can anyone tell me what I am doing wrong.

Peter Sparkes


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]