why this code isn't work ??

N

Nathan

var oNetwork = new ActiveXObject("WScript.Network");
var strUserName = oNetwork.UserName;
XDocument.DOM.selectsingleNode("/my:myFields/my:Username").text = strUsername;

always get message : "Object doen't support this property or method"
I just want to get the username into a textbox.

yupp! I'm a beginner, so please help...
thx
 
T

Teuvo Tarvainen

Try this one:

var oNetwork = new ActiveXObject("WScript.Network");
var strUserName = oNetwork.UserName;
XDocument.DOM.selectSingleNode("/my:myFields/my:Username").text =
strUserName;

Be careful with Upper and Lower cases

Hope this helps,

Teuvo
 
N

Nathan

Thx 4 the clue... I guess i'm quite careless enough... =b
however still got an error message :
'XDocument.DOM.selectSingleNode(...)' is null or not an object


rgrds,
NBW
 
N

Nathan

I'm so sorry Teuvo... =)
my mistake.. urgghh... (again n again...)

I change my code a little bit :
XDocument.DOM.selectSingleNode("//my:Username").text = strUserName;

everything is work fine now, Thanks a lot
=)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

getcurrentuser 1
Get User Name in a Form 2
'null' is null or not an object 3
Error: Infopath 0
On Load event - Computername and Username 3
Several problems 1
Why doesn't this work? 0
Insufficient Memory error 0

Top